home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / byt0486a.arc / ATOMTLBX.LBR / MANUAL.DOC < prev    next >
Text File  |  1986-04-11  |  122KB  |  3,444 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                          ATOMCC USER MANUAL
  21.                          ------ ---- ------
  22.  
  23.                     For Micro-Computers on MSDOS
  24.  
  25.                             Version 7.10
  26.  
  27.                                  by
  28.  
  29.  
  30.                             Y. F. Chang
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. Copyright (C) 1983, 1985 Y. F. Chang
  55.  
  56. MSDOS is a registered trademark of Microsoft Corp.
  57.  
  58.  
  59.                               - i -
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.                     Table of Contents
  67.  
  68.  
  69. Chapter 1 Introduction                                        1
  70.  
  71.    1.1 The Major Advancements in this Version                 1
  72.    1.2 Purpose and Requirements of the Translator             1
  73.    1.3 Applicability                                          2
  74.    1.4 System Overview                                        4
  75.  
  76.       1.4.1 The Translator, ATOMCC                            4
  77.       1.4.2 Tha Object Program, ATSPGM                        4
  78.  
  79.    1.5 Purpose of the User Manual                             5
  80.    1.6 Acknowledgements                                       6
  81.    1.7 References                                             6
  82.  
  83. Chapter 2 For New Users                                       8
  84.  
  85.    2.1 Task of the ATOMCC Translator                          8
  86.    2.2 Using the ATOMCC system                                9
  87.  
  88.       2.2.1 Step 1 - edit ODEINP                              10
  89.       2.2.2 Step 2 - Run ATOMCC                               14
  90.       2.2.3 Step 3 and 4 - Compile and link ATSPGM            15
  91.       2.2.4 Step 5 - Prepare the data                         15
  92.       2.2.5 Step 6 - Run ATSPGM                               16
  93.  
  94.    2.3 Output at equally spaced points                        17
  95.  
  96.       2.3.1 ZEROT - Stopping at roots of variables            17
  97.       2.3.2 MSTIFF=20,21,22 - Stiff problems.                 18
  98.  
  99. Chapter 3 How to Use ----                                     20
  100.  
  101.    3.1 Solving your problem                                   20
  102.  
  103.       3.1.1 Translator file, ODEINP                           20
  104.       3.1.2 Translator file, the terminal                     22
  105.       3.1.3 Translator file, ATSPGM                           23
  106.       3.1.4 DATA input file                                   27
  107.       3.1.5 Solution file                                     28
  108.       3.1.6 User files                                        29
  109.  
  110.    3.2 Using block 1                                          29
  111.  
  112.       3.2.1 Format for the system of equations                30
  113.       3.2.2 Parameters in the equations                       31
  114.       3.2.3 COPTION DOUBLE - Double-precision ATSPGM          31
  115.       3.2.4 COPTION COMPLX - Complex ATSPGM                   32
  116.       3.2.5 COPTION DOUBLE, COMPLX - Double-complex ATSPGM    33
  117.       3.2.6 COPTION LENVAR=n - Series length                  35
  118.       3.2.7 COPTION DUMP=n - Diagnostic messages              36
  119.  
  120.  
  121.                               - ii -
  122.  
  123.  
  124.  
  125.    3.3 Using block 2                                          36
  126.  
  127.       3.3.1 Subroutine form of ATSPGM                         37
  128.       3.3.2 User declarations                                 37
  129.       3.3.3 Common blocks for user                            38
  130.  
  131.    3.4 Using block 3                                          38
  132.  
  133.       3.4.1 Initial conditions                                39
  134.       3.4.2 Parameters in the differential equations          39
  135.       3.4.3 Solve a problem repeatedly                        40
  136.       3.4.4 START, END - Interval of integration              40
  137.       3.4.5 NSTEPS - Number of integration steps, default=40  40
  138.       3.4.6 H - Initial trial stepsize, default = 1.0         41
  139.       3.4.7 ERRLIM - Preset accuracy of the solution          41
  140.       3.4.8 ADJSTF - Error control for stiff problems         41
  141.       3.4.9 LENSER - Length of series used, default=30        42
  142.       3.4.10 MPRINT - Amount of print produced, default=4     42
  143.       3.4.11 DLTXPT - Print point increments, default = 0.0   43
  144.       3.4.12 KTRDCV - Dynamic suppression of CALL RDCV        43
  145.       3.4.13 KPTS - Number of points on complex path          44
  146.       3.4.14 POINTS - Complex path of integration             44
  147.       3.4.15 MSTIFF=10 - Solutions which are entire           44
  148.       3.4.16 MSTIFF=20,21,22 - Stiff problems.                44
  149.          3.4.16.1 Steady-State Stiff Problems                 45
  150.  
  151.    3.5 Using block 4                                          46
  152.  
  153.       3.5.1 Automatic printing of output points               46
  154.       3.5.2 User controlled printing of output points         47
  155.       3.5.3 Logarithmic spacing of output points              48
  156.       3.5.4 ZEROT - Stopping & printing at roots of variables 48
  157.       3.5.5 Finding singularities in real solutions           49
  158.       3.5.6 Stopping short of a singularity                   51
  159.  
  160.    3.6 Editing of ATSPGM                                      51
  161.  
  162.       3.6.1 TERM - Fast generation of print at output points  51
  163.  
  164.    3.7 Large systems                                          54
  165.    3.8 Solving ODE's in the complex domain                    54
  166.  
  167.  
  168.                                - 1 -
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.                              Chapter 1
  178.  
  179.                             Introduction
  180.  
  181.  
  182.  
  183.     This chapter is written to help you become familiar with the
  184. purpose and requirements of the ATOMCC system and with the
  185. organization of this manual.
  186.  
  187.  
  188.  
  189.  
  190. 1.1 The Major Advancements in this Version
  191.  
  192.  
  193.     The present version of ATOMCC, 7.10 for micros, contains a
  194. major advancement.  Now, the ATOMCC system will solve stiff
  195. problems.  This represents a significant departure from the central
  196. premise of the ATOMCC system, which is precise error control.  For
  197. non-stiff problems, the user still have the most accurately
  198. controlled numerical method ever developed.  For many problems, the
  199. precision is so good that there is ALMOST global error control.
  200.  
  201.     For stiff problems, due to the nature of the "approximating"
  202. solution, there cannot be true error control.  Therefore, the
  203. controlling parameter for errors in stiff problems is called
  204. ADJSTF.  It is only meant to be an adjusting constant that can be
  205. loosely refered to as an error control.
  206.  
  207.     There is also another particularly useful feature in the
  208. current version.  All the dependent variables are now placed into a
  209. temporary two-dimensional array (TMPS) by an EQUIVALENCE
  210. statement.  This allows the user to reference each variable by an
  211. index value.  For a system with x, y, and z as functions of t, the
  212. term y(5) can be also refered to as TMPS(5,2).  Similarly, z(23) =
  213. TMPS(23,3).
  214.  
  215.  
  216.  
  217.  
  218. 1.2 Purpose and Requirements of the Translator
  219.  
  220.  
  221.     The ATOMCC system is a tool to be used in the solution of all
  222. initial value problems in ordinary differential equations, (stiff
  223. as well as non-stiff).  It is simple enough to be used by students,
  224. practical enough to be used by engineers, and versatile enough to
  225. be used by research mathematicians.
  226.  
  227.     The ATOMCC package is delivered on floppy disks.  It uses
  228. Microsoft-FORTRAN77 (a registered trademark of Microsoft Corp.)
  229.  
  230.  
  231.                                - 2 -
  232.  
  233.  
  234. and works on a micro-computer operating under MS-DOS.  With the
  235. ATOMCC system, you now have in your possession a research tool
  236. whose capabilities far exceed those of standard numerical
  237. integration methods available on main-frame computers.  To be able
  238. to run ATOMCC on your MSDOS micro-computer, you must have the
  239. following hardware and software:-
  240.  
  241.   -  an MSDOS computer, with an 8087 co-processor;
  242.  
  243.   -  at least 256K of RAM memory;
  244.  
  245.   -  two floppy disc drives, or a hard disc drive;
  246.  
  247.   -  the Microsoft-FORTRAN77 version 3.30.
  248.  
  249.     A complete system includes the following disc files.
  250.  
  251.   -  The ATOMCC system files are:-
  252.  
  253.      ATOMCC.EXE     This is the ATOMCC compiler that reads
  254.                     statements of differential equations and
  255.                     generates an object FORTRAN program called
  256.                     ATSPGM.  The name ATSPGM for the object program
  257.                     file is fixed, but you may change it after it
  258.                     has been written by ATOMCC.
  259.  
  260.      RDCV.OBJ       This is the ATOMCC subroutine library in
  261.                     single-precision.
  262.  
  263.      DRDCV.OBJ      This is the ATOMCC subroutine library in
  264.                     double-precision.
  265.  
  266.      CRDCV.OBJ      This is the ATOMCC subroutine library in
  267.                     complex.
  268.  
  269.      CDRDCV.OBJ     This is the ATOMCC subroutine library in
  270.                     complex-double.
  271.  
  272.   -  The Microsoft-FORTRAN77 files are descripted in the Microsoft
  273.      manual.  The relevant files are:- FOR1.EXE, PAS2.EXE,
  274.      LINK.EXE, and FORTRAN.LIB.
  275.  
  276.     Throughout the discussions in this User Manual, we shall assume
  277. that all of the ATOMCC system files are on the A: floppy-disk
  278. drive, and the Microsoft-FORTRAN77 files are on the B: drive.
  279.  
  280.  
  281.  
  282.  
  283. 1.3 Applicability
  284.  
  285.  
  286.   -  The ATOMCC method can solve:
  287.  
  288.        *  systems of stiff and non-stiff systems of initial value
  289.           problems in ordinary differential equations in which
  290.  
  291.  
  292.                                - 3 -
  293.  
  294.  
  295.        *  the highest order derivative of each dependent variable
  296.           is given explicitly on the left hand side of an equation,
  297.           whose right hand side has a finite sequence of +, -, *,
  298.           /, **, EXP, SIN, COS, TAN, SINH, COSH, TANH, ALOG, ACOS,
  299.           ASIN, ATAN, or any function which is the solution to a
  300.           differential equation.
  301.  
  302.   -  The known limitations of ATOMCC are:
  303.  
  304.        *  the derivatives may be of order at most 6, and
  305.  
  306.        *  there are at most 900 equations in the system.
  307.  
  308.   -  ATOMCC can also solve (with manual intervention):
  309.  
  310.        *  solutions which are polynomials,
  311.  
  312.        *  singular problems which require the application of
  313.           l'Hopital's rule, or
  314.  
  315.        *  problems which have catastrophic subtractive errors in
  316.           series generation.
  317.  
  318.   -  ATOMCC is most attractive for:-
  319.  
  320.        *  problems with stringent accuracy requirements,
  321.  
  322.        *  stiff problems,
  323.  
  324.        *  problems which must be solved repeatedly (such as
  325.           parameter identification), or
  326.  
  327.        *  quick and easy problems (students' assignments).
  328.  
  329.   -  The very high order and precise error control used by ATOMCC
  330.      have enabled it to solve many problems which other methods
  331.      were unable to solve.
  332.  
  333.   -  The ATOMCC compiler allows for the solution of ODE's in the
  334.      complex domain.  This unique capability can be used to explore
  335.      the structure of the singularities in the complex domain of
  336.      non-linear problems.  The analytic information about the
  337.      location and order of singularities in the solution provides
  338.      insight into the behavior of the system.  This method has been
  339.      used to map the first mathematical natural boundary discovered
  340.      in the solution of a nonlinear dynamics problem (7).
  341.  
  342.   -  The complexity and execution time of ATSPGM depend on the
  343.      number of functions and on the number of multiplications in
  344.      the ODE system, not on the number of equations in the ODE
  345.      system nor on the order of the derivatives involved.  There is
  346.      no penalty for high-order derivatives.
  347.  
  348.   -  As with all numerical methods, there is no substitute for
  349.      insight into the structure of the ODE system and for the
  350.      application of clever transformations.
  351.  
  352.  
  353.                                - 4 -
  354.  
  355.  
  356.     Solutions which are entire (have no singularities in the finite
  357. plane), should not be solved using the ATOMCC system.  It is a
  358. total waste of computing power to solve linear problems using
  359. ATOMCC.  This is particularly true for linear 'stiff' problems.
  360.  
  361.     It can be EASILY show that ALL solutions that are entire can be
  362. solved in quasi-closed forms.  This INCLUDES two-point boundary
  363. value problems!
  364.  
  365.     Some special circumstances, which rarely occur, are identified
  366. either by ATOMCC or by the series analysis software, and an
  367. appropriate message is produced.  In such cases, the user should
  368. examine the series (using MPRINT=10 in the third block), and seek
  369. the advice of the authors.
  370.  
  371.  
  372.  
  373.  
  374. 1.4 System Overview
  375.  
  376.  
  377. 1.4.1 The Translator, ATOMCC
  378.  
  379.     The ATOMCC translator is an ODE-solving compiler written in
  380. FORTRAN.  The ODE system to be solved is written into the ODEINP
  381. input file using conventions discussed in Chapters 2 and 3. The
  382. name ODEINP for the input file is fixed within ATOMCC; you must use
  383. this name.  ATOMCC reads ODEINP and produces a FORTRAN object
  384. program, called ATSPGM.  The name ATSPGM for the object program is
  385. also fixed; you must have a file by this name on your disc even if
  386. it is an empty file.  The numerical solution to the ODE system is
  387. obtained by compiling and executing ATSPGM together with the
  388. library subroutine RDCV.OBJ or one of its variants.
  389.  
  390.     ATOMCC accepts four blocks of data from ODEINP in which the
  391. user specifies the differential equations, the integration
  392. interval, initial conditions, and various other parameters to be
  393. used in the solution.  The first block is used to specify the
  394. differential equations and commands to ATOMCC.  The second through
  395. fourth blocks are used to insert statements directly into ATSPGM.
  396. The third block is required to specify the integration interval and
  397. the initial conditions.  Detailed guidelines for the use of each
  398. block appear in Chapter 3.
  399.  
  400.  
  401. 1.4.2 Tha Object Program, ATSPGM
  402.  
  403.     The ATSPGM object program implements the Taylor series
  404. algorithm for solving initial value problems in ordinary
  405. differential equations.  This Taylor series algorithm is outlined
  406. below.
  407.  
  408.   -  Initialize method control parameters which may be modified.
  409.  
  410.   -  Assign initial conditions, the integration interval, and
  411.      method control parameters.
  412.  
  413.  
  414.                                - 5 -
  415.  
  416.  
  417.   -  Initialize method control parameters which may not be
  418.      modified.
  419.  
  420.   -  Loop for each integration step.
  421.  
  422.        *  Initialize the first few series terms.
  423.  
  424.        *  Generate the entire series.
  425.  
  426.        *  Call subroutine RDCV to determine the optimal stepsize
  427.           from (a)the location and order of the primary
  428.           singularities, (b)the series length, (c)the error
  429.           tolerance, and (d)adjust the stepsize.
  430.  
  431.        *  Call subroutine RSET to perform analytic continuation,
  432.           and to print the solution.
  433.  
  434.     In ATSPGM, the stepsize used to expand the series is related to
  435. the radius of convergence at each integration step.  After a series
  436. is generated, the location and order of the primary singularity are
  437. calculated.  Then, the stepsize is adjusted to control the error in
  438. the following manner.  The terms of the series for a function g(x)
  439. expanded at Xo with a stepsize of H := X-Xo are stored as reduced
  440. derivatives, G(k+1) := G(k) (Xo) H**k/k!.  The stepsize H can be
  441. varied to control the error by multiplying G(k+1) by (HNEW/H)**k.
  442.  
  443.     An exception is made in the solution of stiff problems.  The
  444. step-size is determined in stiff problems by the length of a
  445. polynomial that can adequately represent the function.
  446.  
  447.     A method which uses an infinite Taylor series is A-stable;
  448. however, in practice the series must be truncated to N terms.
  449. Then, the characteristic polynomial is p(x,y) = x - Sum[y(k)/k!].
  450. For example, the real-valued stability intervals are (-8.85,0),
  451. (-12.58,0), and (-16.29,0) for N = 20, 30, and 40, respectively.
  452. Taylor series methods are best suited to solve problems with high
  453. accuracy.  However, since very high order derivatives are used in
  454. these methods, the solution of stiff problems can be easily solved
  455. using the approximation of a polynomial with an exponential.
  456.  
  457.  
  458.  
  459.  
  460. 1.5 Purpose of the User Manual
  461.  
  462.  
  463.     This ATOMCC User Manual is designed to support easy, and
  464. efficient use of the ATOMCC system.  Chapter 2 may be used as a
  465. tutorial; the rest of this User Manual is written as a reference
  466. manual, not as a tutorial, so information is repeated as
  467. appropriate when it applies to different issues.
  468.  
  469.     Chapter 1 presents an overview of the ATOMCC system to help you
  470. understand how its components fit together.  This information is
  471. helpful to using the system as described in the rest of the
  472. manual.  A more detailed discussion can be found in references (3)
  473. and (5).
  474.  
  475.  
  476.                                - 6 -
  477.  
  478.  
  479.     Chapter 2 is written as a tutorial for new users of the ATOMCC
  480. system.  Its purpose is to show you how to use the ATOMCC system to
  481. solve initial value problems in ODE's.  It assumes that you are
  482. familiar with FORTRAN programming, and with the concept of comput-
  483. ing a solution to a system of ODE's.  It gives examples showing how
  484. to solve some specific differential equations.
  485.  
  486.     Chapter 3 is written for users who already have some experience
  487. using the ATOMCC system.  This chapter is the heart of this User
  488. Manual.  It attempts to show you how to use each of the features
  489. available from the ATOMCC translator and from the ATSPGM object
  490. program.  It is organized for reference, not for sequential
  491. reading.
  492.  
  493.  
  494.  
  495.  
  496. 1.6 Acknowledgements
  497.  
  498.  
  499.     The author would like to express his gratitude to Roy Morris
  500. for the initial design and coding of the translator program, to
  501. students John Fauss, David Lowery, and Manuel Prieto for their work
  502. on series analysis, to Ray Moore, Mike Tabor, John Weiss, Mike
  503. Ziegler, Phil Bender, and others for many helpful suggestions, and
  504. to Jon Wright for the many suggestions which arose from his
  505. extensive use of the ATOMCC system.  He is particularly indebted to
  506. Professor George Corliss, who assisted him in every aspect of this
  507. program.
  508.  
  509.  
  510.  
  511.  
  512. 1.7 References
  513.  
  514.  
  515.     Here we include some references which are relevant to the
  516. ATOMCC system.  A more complete list of references appears in
  517. refernce(5).
  518.  
  519.   1.  D. Barton, I. M. Willers, and R. V. M. Zahar, The automatic
  520.       solution of ordinary differential equations by the method of
  521.       Taylor series, Comput. J., v. 14, 1971, pp. 243-248.
  522.  
  523.   2.  Y. F. Chang, Automatic solution of differential equations, in
  524.       Constructive and Computational Methods for Differential and
  525.       Integral Equations, edited by D. L. Colton and R. P. Gilbert,
  526.       Lecture Notes in Math., vol. 430, Springer-Verlag, New York,
  527.       1974, pp. 61-94.
  528.  
  529.   3.  Y. F. Chang and G. F. Corliss, Compiler for the solution of
  530.       ordinary differential equations using Taylor series,
  531.       Marquette University technical report, 1981.
  532.  
  533.   4.  Y. F. Chang and G. F. Corliss, Ratio-like and recurrence
  534.       relation tests for convergence of series, J. Inst. Math.
  535.       Appl., v. 25, 1980, pp. 349-359.
  536.  
  537.  
  538.                                - 7 -
  539.  
  540.  
  541.   5.  Y. F. Chang and G. F. Corliss, Solving ordinary differential
  542.       equations using Taylor series, ACM Trans. Math. Soft, v. 8,
  543.       1982, pp. 114-144.
  544.  
  545.   6.  Y. F. Chang, J. Fauss, M. Prieto and G. F. Corliss,
  546.       Convergence analysis of compound Taylor series, Proceedings
  547.       of the Seventh Conference on Numerical Mathematics and
  548.       Computing, University of Manitoba, 1978, pp. 129-152.
  549.  
  550.   7.  Y. F. Chang, M. Tabor, J. Weiss, and G. Corliss, On the
  551.       analytic structure of the Henon Heiles system, Phys. Lett.
  552.       85A (1981), pp. 211-213.
  553.  
  554.   8.  G. F. Corliss, Integrating ODE's in the complex plane - Pole
  555.       vaulting, Math. Comp., v. 35, 1980, pp. 1181-1189.
  556.  
  557.   9.  G. F. Corliss and D. Lowery, Choosing a stepsize for Taylor
  558.       series methods for solving ODE's, J. Comput. Appl. Math., v.
  559.       3, 1977, pp. 251-256.
  560.  
  561.   10. R. E. Moore, Interval Analysis, Prentice-Hall, Englewood
  562.       Cliffs, NJ, 1966.
  563.  
  564.   11. L. B. Rall, Automatic Differentiation: Techniques and
  565.       Applications, Lecture Notes in Computer Science #120,
  566.       Springer-Verlag, Berlin, 1981.
  567.  
  568.  
  569.                                - 8 -
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.                              Chapter 2
  579.  
  580.                            For New Users
  581.  
  582.  
  583.  
  584.     This Chapter is written for new users of the ATOMCC system.
  585. Its purpose is to show how to use this system to solve initial
  586. value problems in ordinary differential equations.  Here, we give
  587. some specific examples of how to solve a system of differential
  588. equations.  More detailed explanations are found in Chapter 3.
  589.  
  590.  
  591.  
  592.  
  593. 2.1 Task of the ATOMCC Translator
  594.  
  595.  
  596.     The ATOMCC system is a tool to help you solve differential
  597. equations.  It consists of two major components:- a translator
  598. program (ATOMCC.EXE), and a subroutine object library (RDCV, DRDCV,
  599. CRDCV, CDRDCV).  To understand the operation of these two
  600. components, you must first understand the six steps involved in
  601. using the system.  We discuss the purpose of each step briefly, to
  602. acquaint you with the terms used in the detailed discussion in
  603. Section 2.2.
  604.  
  605.     At Step 1 (edit ODEINP), the system of differential equations
  606. are stated in the form which ATOMCC expects.  The input file ODEINP
  607. contains four separate blocks.  (The name ODEINP is fixed within
  608. ATOMCC; so you must use this name.)  The first block contains the
  609. differential and algebraic equations.  ATOMCC compiler processes
  610. the data in this block to produce a FORTRAN object program ATSPGM
  611. which is then compiled and executed to solve the problem.  (The
  612. name ATSPGM is also fixed within ATOMCC.)  The second, third, and
  613. fourth blocks are copied unchanged from ODEINP to predetermined
  614. locations in ATSPGM.
  615.  
  616.     At Step 2 (run ATOMCC), ATOMCC (a)reads the first block from
  617. ODEINP, (b)analyzes the differential equations, and (c)copies the
  618. second, third, and fourth blocks from ODEINP directly into ATSPGM
  619. at locations shown by examples below.
  620.  
  621.     At Step 3 (compile ATSPGM), the ATSPGM program is compiled
  622. using Microsoft-FORTRAN ver 3.30 compiler.
  623.  
  624.     At step 4 (link ATSPGM & RDCV), ATSPGM.OBJ is linked with the
  625. ATOMCC subroutine library RDCV.OBJ and FORTRAN.LIB to produce an
  626. executable module, ATSPGM.EXE.
  627.  
  628.     The recommended manner to supply the initial conditions, the
  629. interval of integration, and control parameters is to read them
  630.  
  631.  
  632.                                - 9 -
  633.  
  634.  
  635. from a data file which you prepare at Step 5. The format of this
  636. data file is completely under your control, as shown by examples
  637. below.  Step 5 may be done at any time before Step 6, and it may be
  638. omitted completely.
  639.  
  640.     At Step 6 (run ATSPGM), the differential equations are solved.
  641. Each component of the equations is expanded in a Taylor series, and
  642. the solution point is moved forward by analytic continuation.
  643. ATSPGM reads the data file prepared at Step 5 and writes the
  644. solution results.  The exact content, format, and location of the
  645. solution results depend on the data in ODEINP prepared at Step 1.
  646. Examples given below and in Chapter 3 show how this is done.
  647.  
  648.           +------------------------+
  649.           l         Step 1         l
  650.           l       edit ODEINP      l
  651.           +------------------------+
  652.                        l
  653.           +------------------------+
  654.           l         Step 2         l
  655.           l     run ATOMCC.EXE     l
  656.           +------------------------+
  657.                        l
  658.           +------------------------+
  659.           l         Step 3         l       +---------------+
  660.           l     compile ATSPGM     l       l   (RDCV.OBJ)  l
  661.           +------------------------+       +---------------+
  662.                        l                           l
  663.                        l <--------------------------
  664.                        l
  665.           +------------------------+       +--------------+
  666.           l         Step 4         l       l    Step 5    l
  667.           l   link ATSPGM & RDCV   l       l prepare data l
  668.           +------------------------+       +--------------+
  669.                        l                           l
  670.                        l <--------------------------
  671.                        l
  672.           +------------------------+
  673.           l         Step 6         l
  674.           l     run ATSPGM.EXE     l
  675.           +------------------------+
  676.  
  677.                  Steps for using the ATOMCC system
  678.  
  679.  
  680.  
  681.  
  682. 2.2 Using the ATOMCC system
  683.  
  684.  
  685.     In this section, we take you step-by-step through an example
  686. using the ATOMCC system.
  687.  
  688.  
  689.                               - 10 -
  690.  
  691.  
  692.  
  693.  
  694. 2.2.1 Step 1 - edit ODEINP
  695.  
  696.     The input file ODEINP specifies for ATOMCC
  697.  
  698.   1.  the system of differential equations to be solved,
  699.  
  700.   2.  how the initial conditions and the interval of integration
  701.       are communicated to ATSPGM, and
  702.  
  703.   3.  the commands to control the operation of ATOMCC or to control
  704.       the execution of ATSPGM.
  705.  
  706.     The statements in ODEINP follows FORTRAN conventions.  A "C" in
  707. column 1 denotes a COMMENT, columns 1-5 are used for label numbers,
  708. column 6 is used for continuation, columns 7-72 contain statements,
  709. and columns 73-80 are ignored.  The statements in ODEINP may be in
  710. either upper-case or lower-case letters.  In our discussions in
  711. this Manual, we use upper-case letters for emphasis.  (One word of
  712. caution:- ATOMCC does not recognize tabs.)
  713.  
  714.                  Example 2-1.  Simple ODEINP file.
  715.  
  716.  
  717. C FIRST PAINLEVE TRANSCENDENT
  718.       DIFF(Y,T,2) = 6.0*Y*Y + T    $
  719.       $
  720. C READ INTEGRATION INTERVAL AND INITIAL CONDITIONS.
  721.       READ(5,1010) START,END,Y(1),Y(2)
  722.  1010 FORMAT(4F10.3)
  723.       WRITE(*,1020) START,END,Y(1),Y(2)
  724.  1020 FORMAT(' SOLVE THE FIRST PAINLEVE TRANSCENDENT' /
  725.      + ' INTERVAL:          ',2F10.3 /
  726.      + ' INITIAL CONDITIONS:',2F10.3 /)       $
  727.       $
  728.  
  729.     ODEINP must contain four blocks.  Each block must terminate
  730. with the block terminator "$" in columns 7-72. Blocks 2 and 4 are
  731. empty in Example 2-1 above.
  732.  
  733.     The first block contains the system of differential equations.
  734. These equations are processed by ATOMCC to determine the recurrence
  735. relations that are written into ATSPGM to generate the Taylor
  736. series for each component of the solution.  To enter the
  737. differential equations, DIFF(Y,X,N) is used to denote the N-th
  738. derivative of Y with respect to X. The value of N may range from 1
  739. to 6, inclusively.  The DIFF(,,) function is used to specify the
  740. system of ODE's with FORTRAN-like statements using standard FORTRAN
  741. operators and functions.
  742.  
  743.     Rarely, ATOMCC may fail to produce the correct ATSPGM for your
  744. problem.  In such a case, write your equations differently using
  745. many auxiliary variables.  This will allow you to solve your
  746. problem; then, send a copy of the ODEINP that caused the problem to
  747. Y. F. Chang, Claremont McKenna College, Claremont, CA, 91711.
  748.  
  749.  
  750.                               - 11 -
  751.  
  752.  
  753.     The first block can also be used to control the operation of
  754. ATOMCC.  The most commonly used option is for ATOMCC to write
  755. ATSPGM in double-precision with a "COPTION DOUBLE" card at the
  756. beginning of block 1.
  757.  
  758.                Example 2-2.  Double precision ATSPGM.
  759.  
  760. COPTION DOUBLE
  761. C
  762. C FIRST PAINLEVE TRANSCENDENT
  763.       DIFF(Y,T,2) = 6.0*Y*Y + T    $
  764.       $
  765. C READ INTEGRATION INTERVAL AND INITIAL CONDITIONS.
  766.       READ(5,1010) START,END,Y(1),Y(2)
  767.  1010 FORMAT(4F10.3)
  768.       WRITE(*,1020) START,END,Y(1),Y(2)
  769.  1020 FORMAT(' SOLVE THE FIRST PAINLEVE TRANSCENDENT' /
  770.      + ' INTERVAL:          ',2F10.3 /
  771.      + ' INITIAL CONDITIONS:',2F10.3 /)       $
  772.       $
  773.  
  774.     The second block is usually empty.  It is used to insert
  775. non-executable FORTRAN statements at the beginning of ATSPGM, such
  776. as a SUBROUTINE card, a DIMENSION card, a COMMON card, etc.
  777.  
  778.     The second, third, and fourth blocks are not processed
  779. syntactically by ATOMCC; they are copied directly from ODEINP into
  780. ATSPGM.  Example 2-3 is the ATSPGM program written by ATOMCC for
  781. the ODEINP file shown in Example 2-1. Notice where block 3 is
  782. copied into an early part of ATSPGM.
  783.  
  784.                Example 2-3.  ATSPGM for Example 2-1.
  785.  
  786.  
  787. c*+*+*+*+*+*
  788. c     This program was produced by the  ATOMCC  translator version 7.10
  789. c                                       Copyright (C) 1985, Y. F. Chang
  790. c*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
  791. c Portions (c) Copyright, Microsoft Corp., 1981.  All rights reserved.
  792. c This program was written for the following inputs
  793. c
  794. C FIRST PAINLEVE TRANSCENDENT
  795. C     DIFF(Y,T,2) = 6.0*Y*Y + T
  796. c--------
  797. c no instructions in second input block
  798. c--------
  799.       COMMON /IPASS/ LENSER,LENVAR,MPRINT,MSTIFF,LRUN,
  800.      + KTRDCV,KNTSTP,KTSTIF,KXPNUM,KDIGS,KENDFG,NTERMS,NOPT
  801.      A /RPASS/ RADIUS,ERRLIM,ADJSTF,RCREAL,RCIMAG,RDCERR
  802.      B /CPASS/ START,END,ORDER
  803.      C /DPASS/ H,HNEW,XPRINT,DLTXPT
  804.       DIMENSION TMPS(  36,  1)
  805.       CHARACTER*6 NAMES
  806.       EQUIVALENCE (TMPS(1,1),Y(1))
  807.       DIMENSION NAMES(1), Y(36), T(2), TMPAAB(30), TMPAAA(30)
  808.       DATA NAMES(1)/'Y.....'/
  809.       Y(33) = 1.1
  810.    10 FORMAT(72H   ATOMCC  Ver. 7.10, Copyright (C) 1985, Y. F. Chang; S
  811.  
  812.  
  813.                               - 12 -
  814.  
  815.  
  816.      Aolution results./9H   ******)
  817.    11 FORMAT(/5X,11HStep number,I6,13H at the point,1P1E12.4/1X,
  818.      A 9Hvalues of )
  819.    12 FORMAT(1X, A6,(1X,1P4E13. 5))
  820.    13 FORMAT(5X,21HStepsize adjusted to ,1PE13.5)
  821.    14 FORMAT(/5X,35HThe solution stopped normally after, I4,24H steps as
  822.      a set by nsteps. )
  823.    16 FORMAT(/5X,63HThe adjustment for stepsize seems to be in a loop. P
  824.      Alease try a /5X,22Hshorter series length. )
  825.       WRITE(*,10)
  826. c--------
  827. c Initialize variables to default values.
  828. c--------
  829.       NSTEPS = 40
  830.       H = 1.E0
  831.       ERRLIM = 1.E- 6
  832.       LENSER = 30
  833.       MPRINT = 4
  834.       NTERMS = 2
  835.       KTRDCV =  1
  836.       ADJSTF = 1.E-2
  837.       MSTIFF =  0
  838.       DLTXPT = 0.E0
  839. c--------
  840. c start of third  input block
  841. c--------
  842. C READ INTEGRATION INTERVAL AND INITIAL CONDITIONS.
  843.       READ(5,1010) START,END,Y(1),Y(2)
  844.  1010 FORMAT(4F10.3)
  845.       WRITE(*,1020) START,END,Y(1),Y(2)
  846.  1020 FORMAT(' SOLVE THE FIRST PAINLEVE TRANSCENDENT' /
  847.      + ' INTERVAL:          ',2F10.3 /
  848.      + ' INITIAL CONDITIONS:',2F10.3 /)
  849. c--------
  850. c end of third  input block
  851. c--------
  852. c More initializations
  853. c--------
  854.       DLTXPT = SIGN(DLTXPT,(END-START))
  855.       H = SIGN(H,(END-START))
  856.       KDIGS =  6
  857.       XPRINT = START + DLTXPT
  858.       KXPNUM = 35
  859.       LENVAR = 36
  860.       LRUN = 1
  861.       KTSTIF = 0
  862.       NUMEQS =   1
  863.       IF(LENSER.GT.(LENVAR- 6)) LENSER = LENVAR -  6
  864.       IF(MPRINT.LT.2) GO TO 17
  865.       WRITE(*,11) KTSTIF,START
  866.          K = Y(33)
  867.          WRITE(*,12) NAMES(K),Y(1), Y(2)
  868. c--------
  869. c Loop for integration steps.  Inside the loop, print the desired output
  870. c--------
  871.    17 DO 27 KINTS=1,NSTEPS
  872.          KOUNT = 0
  873.          KNTSTP = KINTS
  874.  
  875.  
  876.                               - 13 -
  877.  
  878.  
  879.    19    CONTINUE
  880.          T(1) = START
  881.          T(2) = H
  882.          Y(2) = Y(2)*(H)
  883. c--------
  884. c Preliminary series calculations
  885. c--------
  886.          TMPAAA(1) = 6.E0*Y(1)
  887.          TMPAAB(1) = TMPAAA(1)*Y(1)
  888.          Y(3) = (TMPAAB(1) + T(1))*(H*H/2.E0)
  889.          TMPAAA(2) = 6.E0*Y(2)
  890.          TMPAAB(2) = TMPAAA(1)*Y(2) + TMPAAA(2)*Y(1)
  891.          Y(4) = (TMPAAB(2) + T(2))*(H*H/6.E0)
  892. c--------
  893. c Loop for series calculations
  894. c--------
  895.          DO 23 K= 5,LENSER
  896.             KA = K - 1
  897.             KB = K - 2
  898.             TMPAAA(KB) = 6.E0*Y(KB)
  899.             TMPAAB(KB) = 0.E0
  900.             KZ = 1 + KB
  901.             DO 30 N=1, KB
  902.                L = KZ - N
  903.                TMPAAB(KB) = TMPAAB(KB) + TMPAAA(N)*Y(L)
  904.    30            CONTINUE
  905.             Y(K) = (TMPAAB(KB))*(H*H/(KB*KA))
  906. c--------
  907. c Test and adjust H to avoid over/under flow.
  908. c--------
  909.             IF(MSTIFF.GE.20 .AND. KTSTIF.GT.0) GO TO 23
  910.             TMP = ABS(Y(K))
  911.             IF(TMP.LE.1.E-35) GO TO 23
  912.             IF(TMP.LT.1.E20 .AND. TMP.GT.1.E-20) GO TO 23
  913.             IF(KTSTIF.NE.0 .AND. TMP.LT.1.0) GO TO 23
  914.             KOUNT = KOUNT + 1
  915.             IF(KOUNT.LT.9) GO TO 22
  916.             WRITE(*,16)
  917.             GO TO 28
  918.    22       CONTINUE
  919.             Y(2) = Y(2)/(H)
  920.             H = H * TMP**(0.3/(1-K))
  921.             IF(MPRINT.GE.4) WRITE(*,13) H
  922.             GO TO 19
  923.    23    LRUN = 1
  924. c--------
  925. c Calculate radius of convergence and take optimum step.
  926. c--------
  927.          CALL RDCV(TMPS,LENVAR,NUMEQS,NAMES)
  928.    24    CALL RSET(TMPS,LENVAR,NUMEQS,NAMES)
  929. c--------
  930. c no instructions in fourth input block
  931. c--------
  932.    25    GO TO (26,28,24), KENDFG
  933.    26    H = SIGN(RADIUS,H)
  934.          START = START + HNEW
  935.          IF(MPRINT.LT.4) GO TO 27
  936.          WRITE(*,11) KNTSTP, START
  937.  
  938.  
  939.                               - 14 -
  940.  
  941.  
  942.          K = Y(33)
  943.          WRITE(*,12) NAMES(K),Y(1), Y(2)
  944.    27 CONTINUE
  945.       WRITE(*,14) NSTEPS
  946.    28 CONTINUE
  947.    29 STOP
  948.       END
  949.  
  950.     The third block is usually used to specify the interval of
  951. integration and the initial conditions by reading them from a data
  952. file prepared at Step 5. This is the file DATA opened in block 3.
  953. The interval of integration is from START to END.  END is allowed
  954. to be less than START for integration in a negative direction.  The
  955. initial values (at START) of a dependent variable named y and its
  956. derivatives are assigned to the array Y as follows:-
  957.  
  958.       Y(1) denotes y at START,
  959.       Y(2) denotes y' at START,
  960.       Y(3) denotes y'' at START, etc.
  961.  
  962. Thus in Example 2-1, two initial conditions Y(1) for y(0) and Y(2)
  963. for y'(0) are entered for the second order differential equation.
  964.  
  965.     Any valid FORTRAN statement may be included in block 3 to be
  966. copied into ATSPGM, as shown in Example 2-1 by the WRITE statement
  967. to echo the input.  The third block may also be used to change the
  968. default values of method-controlling variables.  You can see in
  969. Example 2-3 that many variables are initialized immediately before
  970. block 3. The meaning of these variables is described in Chapter 3.
  971.  
  972.     The fourth block is usually empty.  It may be used to insert
  973. statements into ATSPGM at the end of each integration step.
  974.  
  975.     This concludes the discussion of how to prepare the input
  976. file.  More information about the use of specific features can be
  977. found in Chapter 3.
  978.  
  979.  
  980. 2.2.2 Step 2 - Run ATOMCC
  981.  
  982.     The appropriate command to execute the ATOMCC compiler is
  983. simply [ATOMCC].  The ATOMCC translator uses two files:- ODEINP for
  984. the equation statements and initial conditions, and ATSPGM for the
  985. output object program.  (The names ODEINP and ATSPGM are fixed
  986. within ATOMCC.)  The messages produced by ATOMCC are placed on your
  987. terminal.  To have the messages written onto a disc file (say MSG),
  988. use the command [ATOMCC > MSG].
  989.  
  990.  
  991.                               - 15 -
  992.  
  993.  
  994.  
  995.          Example 2-4.  Translator messages for Example 2-1.
  996.  
  997.  
  998.               ATOMCC Ver. 7.10, Copyright (C) 1985, Y. F. Chang.
  999.               --------------------------------------------------
  1000.  Portions (c) Copyright, Microsoft Corp., 1981.  All rights reserved.
  1001.  
  1002.  
  1003.   FIRST PAINLEVE TRANSCENDENT
  1004.       DIFF(Y,T,2) = 6.0*Y*Y + T    $
  1005.   equation   1 is in position   1
  1006.       $
  1007.   READ INTEGRATION INTERVAL AND INITIAL CONDITIONS.
  1008.       READ(5,1010) START,END,Y(1),Y(2)
  1009.  1010 FORMAT(4F10.3)
  1010.       WRITE(*,1020) START,END,Y(1),Y(2)
  1011.  1020 FORMAT(' SOLVE THE FIRST PAINLEVE TRANSCENDENT' /
  1012.      + ' INTERVAL:          ',2F10.3 /
  1013.      + ' INITIAL CONDITIONS:',2F10.3 /)       $
  1014.       $
  1015.           ATOMCC completed
  1016.  Stop - Program terminated.
  1017.  
  1018.  
  1019. 2.2.3 Step 3 and 4 - Compile and link ATSPGM
  1020.  
  1021.     As you get comfortable with the ATOMCC system, you will rarely
  1022. inspect ATSPGM, unless either an error occurs, or you choose to
  1023. edit ATSPGM by hand.
  1024.  
  1025.     ATSPGM, written by ATOMCC, is just like any other FORTRAN
  1026. program; you may edit it to suit your needs.  Whether edited or
  1027. not, ATSPGM is ready to be compiled and linked with the necessary
  1028. subroutines from the ATOMCC library (RDCV).
  1029.  
  1030.     The appropriate commands to compile and link ATSPGM are:-
  1031.  
  1032.   -  B:FOR1 ATSPGM.  ;
  1033.  
  1034.   -  B:PAS2
  1035.  
  1036.   -  B:LINK ATSPGM+RDCV,,NUL,B:
  1037.  
  1038.  
  1039. 2.2.4 Step 5 - Prepare the data
  1040.  
  1041.     At Step 1, when you prepared ODEINP for ATOMCC, you may have
  1042. included some READ statements in block 3 to communicate the
  1043. interval of integration and the initial conditions to ATSPGM.
  1044. Before you run ATSPGM, the data file to be read by those statements
  1045. must be prepared with the appropriate file name given in your OPEN
  1046. statement.
  1047.  
  1048.  
  1049.                               - 16 -
  1050.  
  1051.  
  1052.  
  1053.               Example 2-5.  Data file for Example 2-1.
  1054.  
  1055.      0.000     1.100     1.000     0.000
  1056.  
  1057.     If you know that you will be solving a simple problem only
  1058. once, Step 5 can be eliminated by stating the values of START, END,
  1059. and the initial conditions with FORTRAN assignment statements in
  1060. block 3 as shown below.
  1061.  
  1062.           Example 2-6.  Assignment statements in block 3.
  1063.  
  1064.  
  1065. C First Painleve transcendent
  1066.       DIFF(Y,T,2) = 6.0*Y*Y + T    $
  1067.       $
  1068. C Assign integration interval and initial conditions.
  1069.       START = 0.0
  1070.       END = 1.1
  1071.       Y(1) = 1.0
  1072.       Y(2) = 0.0
  1073.       WRITE(*,1020) START,END,Y(1),Y(2)
  1074.  1020 FORMAT(' Solve the first Painleve transcendent' /
  1075.      +  ' Interval:          ',2F10.3 /
  1076.      +  ' Initial conditions:',2F10.3 /)       $
  1077.       $
  1078.  
  1079.  
  1080. 2.2.5 Step 6 - Run ATSPGM
  1081.  
  1082.     At step 6, you are ready to run ATSPGM; the command is simply
  1083. [ATSPGM].  ATSPGM writes its output to your terminal, for solution
  1084. output on a disc file (say PRTOUT) use [ATSPGM > PRTOUT].
  1085.  
  1086.            Example 2-7.  Solution Output for Example 2-1.
  1087.  
  1088.  
  1089.   ATOMCC  Ver. 7.10, Copyright (C) 1985, Y. F. Chang; Solution results.
  1090.   ******
  1091. SOLVE THE FIRST PAINLEVE TRANSCENDENT
  1092. INTERVAL:                .000     1.100
  1093. INITIAL CONDITIONS:     1.000      .000
  1094.  
  1095.     Step number     0 at the point   .0000E+00
  1096. values of
  1097. Y.....   1.00000E+00   .00000E+00
  1098.  
  1099.     Step number     1 at the point  7.1000E-01
  1100. values of
  1101. Y.....   4.04877E+00  1.62701E+01
  1102.  
  1103.  
  1104.                               - 17 -
  1105.  
  1106.  
  1107.  
  1108.  
  1109.     Step number     2 at the point  1.0100E+00
  1110. values of
  1111. Y.....   2.58324E+01  2.62656E+02
  1112.  
  1113.     Step number     3 at the point  1.1000E+00
  1114. values of
  1115. Y.....   8.77693E+01  1.64459E+03
  1116. Stop - Program terminated.
  1117.  
  1118.  
  1119.  
  1120.  
  1121. 2.3 Output at equally spaced points
  1122.  
  1123.  
  1124.     You should be able to use ATOMCC to solve routine problems.
  1125. The points at which ATSPGM computes the solutions are determined by
  1126. the actual integration steps taken, which are not uniform in size.
  1127. This Section shows you how to force ATSPGM to print the solutions
  1128. at equally spaced points.
  1129.  
  1130.     The output from ATSPGM is controlled by two variables, MPRINT
  1131. (amount of print), and DLTXPT (print interval).  To produce output
  1132. at equally spaced points, assign MPRINT=2 to turn off the print at
  1133. the actual integration steps, and assign DLTXPT=DELTA, where DELTA
  1134. is your desired print interval.
  1135.  
  1136.             Example 2-8.  Equally spaced output points.
  1137.  
  1138.  
  1139. c First Painleve transcendent
  1140.       DIFF(Y,T,2) = 6.0*Y*Y + T    $
  1141.       $
  1142. c Assign integration interval and initial conditions.
  1143.       MPRINT = 2
  1144.       DLTXPT = 0.2
  1145.       START = 0.0
  1146.       END = 1.1
  1147.       Y(1) = 1.0
  1148.       Y(2) = 0.0
  1149.       WRITE(*,1020) START,END,Y(1),Y(2)
  1150.  1020 FORMAT(' Solve the first Painleve transcendent' /
  1151.      +  ' Interval:          ',2F10.3 /
  1152.      +  ' Initial conditions:',2F10.3 /)       $
  1153.       $
  1154.  
  1155.  
  1156. 2.3.1 ZEROT - Stopping at roots of variables
  1157.  
  1158.     It is often of interest to locate points at which a component
  1159. of the solution has a root or assumes some specified value.  The
  1160. subroutine ZEROT automatically solve such problems.  DZEROT is the
  1161. double-precision version.
  1162.  
  1163.  
  1164.                               - 18 -
  1165.  
  1166.  
  1167.     The form of the CALL is
  1168.  
  1169.              CALL ZEROT(NUMBER,Y,ROOT,KEY,TMPS,LENVAR,NUMEQS)
  1170.  
  1171.     where
  1172.  
  1173.     NUMBER is the index of the Y series term whose root is sought,
  1174.     Y      is the variable whose root is desired,
  1175.     ROOT   is the value Y is to assume (= 0 for a root),
  1176.     KEY    is 1 if Y is a dependent variable, or
  1177.               0 if Y is not a dependent variable.
  1178.  
  1179.     The arguements TMPS, LENVAR, and NUMEQS must be exactly as
  1180. written above.
  1181.  
  1182.                Example 3-16.  Rootfinding with ZEROT.
  1183.  
  1184.  
  1185.       DIFF(Y,T,2) = 6*Y*Y + T  $
  1186.       $
  1187.       START = 0.0
  1188.       END = 1.15
  1189.       ROOT = 20.0
  1190.       Y(1) = 1.0
  1191.       Y(2) = 0.0
  1192.       $
  1193.       CALL ZEROT(1,Y,ROOT,1)
  1194.       $
  1195.  
  1196.     When the variable whose root is being sought is not a dependent
  1197. variable, KEY is set to 0.
  1198.  
  1199.         CALL ZEROT(2,VARY,0.0,0)
  1200.         IF(LRUN.NE.0) GO TO 25
  1201.         TEMP = START + HNEW
  1202.         WRITE(7,1010) KINTS,TEMP,VARY(1),VARY(2)
  1203.    1010 FORMAT(I5,3F10.4)
  1204.         GO TO 25  $
  1205.  
  1206.     In these examples, it is not necessary for one to print the
  1207. information as shown in the second case.  The ATSPGM program does
  1208. stop and restart the solution automatically at the exact root and
  1209. the output is controlled by MPRINT.
  1210.  
  1211.     The index NUMBER can be set at any positive (non-zero) integer
  1212. value; however, obviously when NUMBER is very large the accuracy of
  1213. the root will suffer.
  1214.  
  1215.  
  1216. 2.3.2 MSTIFF=20,21,22 - Stiff problems.
  1217.  
  1218.     This version of ATOMCC contains a double-precision algorithm to
  1219. solve stiff problems.  To use it, one can either set MSTIFF=20, or
  1220. 21, or 22. Other parameters that should be controlled are H,
  1221. ADJSTF, and NSTEPS.  It is also desirable to set MPRINT to 7, at
  1222. least initially, for observing the progress of the solution.  If it
  1223. should be evident that the problem is not really stiff, then it is
  1224. most advisable to solve it as a normal problem.
  1225.  
  1226.  
  1227.                               - 19 -
  1228.  
  1229.  
  1230.     MSTIFF=20 is the more conservative of the three algorithms.  In
  1231. this case, LENSER is set to be 15. The default value for ADJSTF,
  1232. the error-controlling parameter, is a rather large 1.E-2. The user
  1233. should run the stiff solution at least one more time with a
  1234. somewhat smaller ADJSTF, say 1.E-3, to check on its validity.
  1235.  
  1236.     When MSTIFF=21, LENSER is set to only 10. So, this option
  1237. should be used only if the user is absolutely certain that the
  1238. problem under study is very stiff.  The solution of stiff problems
  1239. under this option is considerably faster than that for MSTIFF=20.
  1240.  
  1241.     MSTIFF=22 is identical to MSTIFF=20 except for the fact that
  1242. there is no attempt to identify steady-state solutions.
  1243.  
  1244.     As mentioned above, the stiff algorithm is written in double-
  1245. precision.  It is simply not cost effective to solve such problems
  1246. using single-precision.  There is one other restriction on stiff
  1247. problems.  All such problems must be stated as first-degree ODE's.
  1248.  
  1249.  
  1250.                               - 20 -
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.                              Chapter 3
  1260.  
  1261.                           How to Use ----
  1262.  
  1263.  
  1264.  
  1265.     This Chapter is written for users who already have solved
  1266. several problems using the ATOMCC system.  It assumes familiarity
  1267. with FORTRAN programming, with Chapter 2, and with the numerical
  1268. solution of ODE's.  This Chapter is the heart of this User Manual.
  1269. It attempts to show how to use each of the features available from
  1270. ATOMCC and from ATSPGM.  It is organized for reference, not for
  1271. sequential reading.  Consequently, some information found in other
  1272. parts of this Manual are repeated here.
  1273.  
  1274.  
  1275.  
  1276.  
  1277. 3.1 Solving your problem
  1278.  
  1279.  
  1280.     The tasks which must be accomplished in order to run the ATOMCC
  1281. system on your computer were discussed in Section 2.2. They are:-
  1282.  
  1283.   Edit     ODEINP      (containing ODE's)
  1284.  
  1285.   Run      ATOMCC.EXE  (execute ATOMCC translator)
  1286.            (This creates ATSPGM, the object FORTRAN program,
  1287.             which is treated like any FORTRAN program.
  1288.             ATSPGM may be edited.)
  1289.  
  1290.   Compile  ATSPGM.
  1291.            (This creates ATSPGM.OBJ, the object module.)
  1292.  
  1293.   Link     ATSPGM.OBJ,  with library options
  1294.                         (RDCV.OBJ    for single precision
  1295.                          DRDCV.OBJ   for double precision
  1296.                          CRDCV.OBJ   for complex, and
  1297.                          CDRDCV.OBJ  for complex double)
  1298.            (This creates ATSPGM.EXE, the execution module.)
  1299.  
  1300.   Edit     DATA input-file if any is used.
  1301.  
  1302.   Run      ATSPGM.EXE
  1303.  
  1304.  
  1305. 3.1.1 Translator file, ODEINP
  1306.  
  1307.     The ODEINP file contains the ODE's to be solved and information
  1308. specifying how the initial conditions and the integration interval
  1309. are determined in ATSPGM.  It may contain commands to control
  1310. (a)the operation of the ATOMCC translator, (b)the execution of the
  1311.  
  1312.  
  1313.                               - 21 -
  1314.  
  1315.  
  1316. solution, and (c)the desired format of the output.  The names
  1317. ODEINP and ATSPGM are fixed within ATOMCC; you must have these
  1318. files on your disc when you execute ATOMCC.
  1319.  
  1320.     The data in ODEINP follows FORTRAN conventions.  Columns 1-5
  1321. are used for line numbers, column 6 is used for continuation
  1322. characters, columns 7-72 contain statements, and columns 73-80 are
  1323. ignored.  As in FORTRAN, all blanks are ignored.  A 'C' in column 1
  1324. denotes a comment which is copied directly into the ATSPGM file.
  1325. The statements in ODEINP can be either upper-case or lower-case
  1326. letters.  We use upper-case in this manual for emphasis.  (A word
  1327. of caution, the tab character is not recognized by ATOMCC.)
  1328.  
  1329.     The ODEINP file contains four blocks.  Each block ends with the
  1330. block terminator symbol '$' in columns 7-72. (A comment card must
  1331. not contain a block terminator '$'.)  Sections 3.2-3.4 discuss each
  1332. of the blocks in detail.  Here is an example of an input file which
  1333. illustrates several of the features which will be discussed in
  1334. Sections 3.2-3.5.
  1335.  
  1336.                      Example 3-1.  ODEINP file.
  1337.  
  1338.  
  1339. C Block 1
  1340. C
  1341. C  System with parameter.
  1342. C
  1343.       DIFF(X,T,2) = - ALPHA*X*R
  1344.       DIFF(Y,T,2) = - ALPHA*Y*R
  1345.       R = (X*X + Y*Y)**(-1.5)
  1346.       ALPHA = 0.65            $
  1347. c
  1348. c Block 2
  1349. c
  1350.       CHARACTER*80 LINE       $
  1351. c
  1352. c Block 3
  1353. c
  1354. c  Read:- heading line, print code, maximum number of integration
  1355. c         steps.
  1356. c  Echo the above.
  1357. c  Read:- heading line, integration interval, print interval,
  1358. c         parameter in equations, initial conditions.
  1359. c  Echo the above.
  1360. c
  1361.       OPEN(5,FILE='DATA')
  1362.       OPEN(7,FILE='PLOTS',STATUS='NEW')
  1363.       READ(5,1010) LINE,MPRINT,NSTEPS
  1364.  1010 FORMAT(A80/2I10)
  1365.       WRITE(*,1010) LINE,MPRINT,NSTEPS
  1366.       READ(5,1020) LINE,START,END,DLTXPT,ALPHA,X(1),X(2),Y(1),Y(2)
  1367.  1020 FORMAT(A80/8F10.3)
  1368.       WRITE(*,1020) LINE,START,END,DLTXPT,ALPHA,X(1),X(2),Y(1),Y(2)
  1369. c  Assignment statements for the error control parameter
  1370.       ERRLIM = 1.0E-04        $
  1371.  
  1372.  
  1373.                               - 22 -
  1374.  
  1375.  
  1376.  
  1377. c
  1378. c Block 4
  1379. c
  1380. c  Produce file of data for plotting.
  1381. c
  1382.       IF(KENDFG.EQ.3) WRITE(7,1030) KINTS,XPRINT,X(1),X(2),Y(1),Y(2)
  1383.  1030 FORMAT(I5,1P5E14.5)     $
  1384.  
  1385.     If you have a simple problem which will be solved only once,
  1386. the contents of the 'DATA' file may be entered directly as data
  1387. into block 3. However, the compilation and linking of the ATSPGM
  1388. file takes an appreciable amount of time and therefore should be
  1389. avoided on problems that is solved more than once.
  1390.  
  1391.     There are two ways to solve a given problem containing
  1392. functions.  Either they can be placed as FORTRAN statements in
  1393. ODEINP to be copied directly into ATSPGM, or they can be inserted
  1394. by editing ATSPGM.  The choice depends on your personal style; the
  1395. authors prefer to work with ODEINP, because it is short.
  1396. Therefore, it is easy to find the correct place to make changes.
  1397. The cost of re-running the ATOMCC translator is well worth the
  1398. convenience, because ATOMCC is very fast.
  1399.  
  1400.  
  1401. 3.1.2 Translator file, the terminal
  1402.  
  1403.     The translator messages contains the information which the
  1404. ATOMCC expects you to inspect.  It includes an echo of the input
  1405. file and any error messages.  The Appendix contains a list of the
  1406. error messages which may be produced.  The messages will appear on
  1407. your terminal.
  1408.  
  1409.          Example 3-2.  Translator messages for Example 3-1.
  1410.  
  1411.  
  1412.              ATOMCC Ver. 7.10, Copyright (C) 1985, Y. F. Chang.
  1413.              --------------------------------------------------
  1414. Portions (c) Copyright, Microsoft Corp., 1981.  All rights reserved.
  1415.  
  1416.  
  1417. c Block 1
  1418.  
  1419. c  System with parameter.
  1420.  
  1421.      DIFF(X,T,2) = - ALPHA*X*R
  1422.      DIFF(Y,T,2) = - ALPHA*Y*R
  1423.      R = (X*X + Y*Y)**(-1.5)
  1424.      ALPHA = 0.65            $
  1425.  equation   3 is in position   1
  1426.  equation   4 is in position   2
  1427.  equation   1 is in position   3
  1428.  equation   2 is in position   4
  1429.  
  1430. c Block 2
  1431.  
  1432.      CHARACTER*80 LINE       $
  1433.  
  1434.  
  1435.                               - 23 -
  1436.  
  1437.  
  1438. c Block 3
  1439.  
  1440. c  Read:- heading line, print code, maximum number of integration
  1441. c         steps.
  1442. c  Echo the above.
  1443. c  Read:- heading line, integration interval, print interval,
  1444. c         parameter in equations, initial conditions.
  1445. c  Echo the above.
  1446.  
  1447.      OPEN(5,FILE='DATA')
  1448.      OPEN(7,FILE='PLOTS',STATUS='NEW')
  1449.      READ(5,1010) LINE,MPRINT,NSTEPS
  1450. 1010 FORMAT(A80/2I10)
  1451.      WRITE(*,1010) LINE,MPRINT,NSTEPS
  1452.      READ(5,1020) LINE,START,END,DLTXPT,ALPHA,X(1),X(2),Y(1),Y(2)
  1453. 1020 FORMAT(A80/8F10.3)
  1454.      WRITE(*,1020) LINE,START,END,DLTXPT,ALPHA,X(1),X(2),Y(1),Y(2)
  1455. c  Assignment statements for the error control parameter
  1456.      ERRLIM = 1.0E-04        $
  1457.  
  1458. c Block 4
  1459.  
  1460. c  Produce file of data for plotting.
  1461.  
  1462.      IF(KENDFG.EQ.3) WRITE(7,1030)KINTS,XPRINT,X(31),X(32),Y(31),Y(32)
  1463. 1030 FORMAT(I5,1P5E14.5)     $
  1464.          ATOMCC completed
  1465. Stop - Program terminated.
  1466.  
  1467.  
  1468. 3.1.3 Translator file, ATSPGM
  1469.  
  1470.     The ATSPGM file contains the FORTRAN object program written by
  1471. ATOMCC to solve the system of differential equations using long
  1472. Taylor series.  ATOMCC uses the variable names given in ODEINP, so
  1473. that ATSPGM appears to have been custom written for the specific
  1474. problem.  Usually you do not need to inspect ATSPGM, but sometimes
  1475. you may find it necessary to edit it like you would edit any other
  1476. FORTRAN program to achieve some particular result.  Section 3.6
  1477. contains an example for which editing of ATSPGM is necessary.
  1478.  
  1479.                Example 3-3.  ATSPGM for Example 3-1.
  1480.  
  1481.  
  1482. c*+*+*+*+*+*
  1483. c     This program was produced by the  ATOMCC  translator version 7.10
  1484. c                                       Copyright (C) 1985, Y. F. Chang
  1485. c*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
  1486. c Portions (c) Copyright, Microsoft Corp., 1981.  All rights reserved.
  1487. c This program was written for the following inputs
  1488. c
  1489. C BLOCK 1
  1490. C  SYSTEM WITH PARAMETER.
  1491. C     DIFF(X,T,2) = - ALPHA*X*R
  1492. C     DIFF(Y,T,2) = - ALPHA*Y*R
  1493. C     R = (X*X + Y*Y)**(-1.5)
  1494. C     ALPHA = 0.65
  1495. c--------
  1496.  
  1497.  
  1498.                               - 24 -
  1499.  
  1500.  
  1501. c start of second input block
  1502. c--------
  1503. c
  1504. c Block 2
  1505. c
  1506.       CHARACTER*80 LINE
  1507. c--------
  1508. c end of second input block
  1509. c--------
  1510.       COMMON /IPASS/ LENSER,LENVAR,MPRINT,MSTIFF,LRUN,
  1511.      + KTRDCV,KNTSTP,KTSTIF,KXPNUM,KDIGS,KENDFG,NTERMS,NOPT
  1512.      A /RPASS/ RADIUS,ERRLIM,ADJSTF,RCREAL,RCIMAG,RDCERR
  1513.      B /CPASS/ START,END,ORDER
  1514.      C /DPASS/ H,HNEW,XPRINT,DLTXPT
  1515.       DIMENSION TMPS(  36,  2)
  1516.       CHARACTER*6 NAMES
  1517.       EQUIVALENCE (TMPS(1,1),X(1)),(TMPS(1,2),Y(1))
  1518.       DIMENSION NAMES(2), T(2), Y(36), X(36), R(30), TMPAAH(30),
  1519.      A  TMPAAG(30), TMPAAF(30), TMPAAE(30), TMPAAD(30), TMPAAC(30),
  1520.      B  TMPAAB(30)
  1521.       DATA NAMES(1)/'X.....'/
  1522.       DATA NAMES(2)/'Y.....'/
  1523.       X(33) = 1.1
  1524.       Y(33) = 2.1
  1525.    10 FORMAT(72H   ATOMCC  Ver. 7.10, Copyright (C) 1985, Y. F. Chang; S
  1526.      Aolution results./9H   ******)
  1527.    11 FORMAT(/5X,11HStep number,I6,13H at the point,1P1E12.4/1X,
  1528.      A 9Hvalues of )
  1529.    12 FORMAT(1X, A6,(1X,1P4E13. 5))
  1530.    13 FORMAT(5X,21HStepsize adjusted to ,1PE13.5)
  1531.    14 FORMAT(/5X,35HThe solution stopped normally after, I4,24H steps as
  1532.      a set by nsteps. )
  1533.    16 FORMAT(/5X,63HThe adjustment for stepsize seems to be in a loop. P
  1534.      Alease try a /5X,22Hshorter series length. )
  1535.       WRITE(*,10)
  1536. c--------
  1537. c Initialize variables to default values.
  1538. c--------
  1539.       NSTEPS = 40
  1540.       H = 1.E0
  1541.       ERRLIM = 1.E- 6
  1542.       LENSER = 30
  1543.       MPRINT = 4
  1544.       NTERMS = 2
  1545.       KTRDCV =  2
  1546.       ADJSTF = 1.E-2
  1547.       MSTIFF =  0
  1548.       DLTXPT = 0.E0
  1549. c--------
  1550. c constant expressions
  1551. c--------
  1552.       ALPHA = 6.5E-1
  1553. c--------
  1554. c start of third  input block
  1555. c--------
  1556. c
  1557. c Block 3
  1558. c
  1559.  
  1560.  
  1561.                               - 25 -
  1562.  
  1563.  
  1564. c  Read:- heading line, print code, maximum number of integration
  1565. c         steps.
  1566. c  Echo the above.
  1567. c  Read:- heading line, integration interval, print interval,
  1568. c         parameter in equations, initial conditions.
  1569. c  Echo the above.
  1570. c
  1571.       OPEN(5,FILE='DATA')
  1572.       OPEN(7,FILE='PLOTS',STATUS='NEW')
  1573.       READ(5,1010) LINE,MPRINT,NSTEPS
  1574.  1010 FORMAT(A80/2I10)
  1575.       WRITE(*,1010) LINE,MPRINT,NSTEPS
  1576.       READ(5,1020) LINE,START,END,DLTXPT,ALPHA,X(1),X(2),Y(1),Y(2)
  1577.  1020 FORMAT(A80/8F10.3)
  1578.       WRITE(*,1020) LINE,START,END,DLTXPT,ALPHA,X(1),X(2),Y(1),Y(2)
  1579. c  Assignment statements for the error control parameter
  1580.       ERRLIM = 1.0E-04
  1581. c--------
  1582. c end of third  input block
  1583. c--------
  1584.       TMPAAA = -1.5E0
  1585. c--------
  1586. c constant expressions
  1587. c--------
  1588. c More initializations
  1589. c--------
  1590.       DLTXPT = SIGN(DLTXPT,(END-START))
  1591.       H = SIGN(H,(END-START))
  1592.       KDIGS =  6
  1593.       XPRINT = START + DLTXPT
  1594.       KXPNUM = 35
  1595.       LENVAR = 36
  1596.       LRUN = 1
  1597.       KTSTIF = 0
  1598.       NUMEQS =   2
  1599.       IF(LENSER.GT.(LENVAR- 6)) LENSER = LENVAR -  6
  1600.       IF(MPRINT.LT.2) GO TO 17
  1601.       WRITE(*,11) KTSTIF,START
  1602.          K = X(33)
  1603.          WRITE(*,12) NAMES(K),X(1), X(2)
  1604.          K = Y(33)
  1605.          WRITE(*,12) NAMES(K),Y(1), Y(2)
  1606. c--------
  1607. c Loop for integration steps.  Inside the loop, print the desired output
  1608. c--------
  1609.    17 DO 27 KINTS=1,NSTEPS
  1610.          KOUNT = 0
  1611.          KNTSTP = KINTS
  1612.    19    CONTINUE
  1613.          T(1) = START
  1614.          T(2) = H
  1615.          X(2) = X(2)*(H)
  1616.          Y(2) = Y(2)*(H)
  1617. c--------
  1618. c Preliminary series calculations
  1619. c--------
  1620.          TMPAAB(1) = X(1)*X(1)
  1621.          TMPAAC(1) = Y(1)*Y(1)
  1622.  
  1623.  
  1624.                               - 26 -
  1625.  
  1626.  
  1627.          TMPAAE(1) = ALPHA*X(1)
  1628.          TMPAAG(1) = ALPHA*Y(1)
  1629.          TMPAAD(1) = TMPAAB(1) + TMPAAC(1)
  1630.          R(1) = TMPAAD(1) ** TMPAAA
  1631.          TMPAAF(1) = TMPAAE(1)*R(1)
  1632.          TMPAAH(1) = TMPAAG(1)*R(1)
  1633.          X(3) = (-TMPAAF(1))*(H*H/2.E0)
  1634.          Y(3) = (-TMPAAH(1))*(H*H/2.E0)
  1635.          TMPAAB(2) = X(1)*X(2) + X(2)*X(1)
  1636.          TMPAAC(2) = Y(1)*Y(2) + Y(2)*Y(1)
  1637.          TMPAAE(2) = ALPHA*X(2)
  1638.          TMPAAG(2) = ALPHA*Y(2)
  1639.          TMPAAD(2) = TMPAAB(2) + TMPAAC(2)
  1640.          R(2) = TMPAAA*R(1)*TMPAAD(2)/TMPAAD(1)
  1641.          TMPAAF(2) = TMPAAE(1)*R(2) + TMPAAE(2)*R(1)
  1642.          TMPAAH(2) = TMPAAG(1)*R(2) + TMPAAG(2)*R(1)
  1643.          X(4) = (-TMPAAF(2))*(H*H/6.E0)
  1644.          Y(4) = (-TMPAAH(2))*(H*H/6.E0)
  1645. c--------
  1646. c Loop for series calculations
  1647. c--------
  1648.          DO 23 K= 5,LENSER
  1649.             KA = K - 1
  1650.             KB = K - 2
  1651.             KC = K - 3
  1652.             TMPAAB(KB) = 0.E0
  1653.             TMPAAC(KB) = 0.E0
  1654.             KZ = 1 + KB
  1655.             DO 30 N=1, KB
  1656.                L = KZ - N
  1657.                TMPAAB(KB) = TMPAAB(KB) + X(N)*X(L)
  1658.                TMPAAC(KB) = TMPAAC(KB) + Y(N)*Y(L)
  1659.    30            CONTINUE
  1660.             TMPAAE(KB) = ALPHA*X(KB)
  1661.             TMPAAG(KB) = ALPHA*Y(KB)
  1662.             TMPAAD(KB) = TMPAAB(KB) + TMPAAC(KB)
  1663.             R(KB) = R(1)*TMPAAD(KC+1)*(KC)*TMPAAA
  1664.             KY = 2 + KC
  1665.             DO 31 N=2, KC
  1666.                L = KY - N
  1667.                AL = (L - 1)
  1668.    31       R(KB) = R(KB) + R(N)*TMPAAD(L)*AL
  1669.      A *TMPAAA - TMPAAD(N)*R(L)*AL
  1670.             R(KB) = R(KB) /(KC)/TMPAAD(1)
  1671.             TMPAAF(KB) = 0.E0
  1672.             TMPAAH(KB) = 0.E0
  1673.             KZ = 1 + KB
  1674.             DO 32 N=1, KB
  1675.                L = KZ - N
  1676.                TMPAAF(KB) = TMPAAF(KB) + TMPAAE(N)*R(L)
  1677.                TMPAAH(KB) = TMPAAH(KB) + TMPAAG(N)*R(L)
  1678.    32            CONTINUE
  1679.             X(K) = (-TMPAAF(KB))*(H*H/(KB*KA))
  1680.             Y(K) = (-TMPAAH(KB))*(H*H/(KB*KA))
  1681. c--------
  1682. c Test and adjust H to avoid over/under flow.
  1683. c--------
  1684.             IF(MSTIFF.GE.20 .AND. KTSTIF.GT.0) GO TO 23
  1685.  
  1686.  
  1687.                               - 27 -
  1688.  
  1689.  
  1690.             TMP = ABS(X(K))
  1691.             IF(TMP.LE.1.E-35) GO TO 23
  1692.             IF(TMP.LT.1.E20 .AND. TMP.GT.1.E-20) GO TO 23
  1693.             IF(KTSTIF.NE.0 .AND. TMP.LT.1.0) GO TO 23
  1694.             KOUNT = KOUNT + 1
  1695.             IF(KOUNT.LT.9) GO TO 22
  1696.             WRITE(*,16)
  1697.             GO TO 28
  1698.    22       CONTINUE
  1699.             X(2) = X(2)/(H)
  1700.             Y(2) = Y(2)/(H)
  1701.             H = H * TMP**(0.3/(1-K))
  1702.             IF(MPRINT.GE.4) WRITE(*,13) H
  1703.             GO TO 19
  1704.    23    LRUN = 1
  1705. c--------
  1706. c Calculate radius of convergence and take optimum step.
  1707. c--------
  1708.          CALL RDCV(TMPS,LENVAR,NUMEQS,NAMES)
  1709.    24    CALL RSET(TMPS,LENVAR,NUMEQS,NAMES)
  1710. c--------
  1711. c start of fourth input block
  1712. c--------
  1713. c
  1714. c Block 4
  1715. c
  1716. c  Produce file of data for plotting.
  1717. c
  1718.       IF(KENDFG.EQ.3) WRITE(7,1030)KINTS,XPRINT,X(31),X(32),Y(31),Y(32)
  1719.  1030 FORMAT(I5,1P5E14.5)
  1720. c--------
  1721. c end of fourth input block
  1722. c--------
  1723.    25    GO TO (26,28,24), KENDFG
  1724.    26    H = SIGN(RADIUS,H)
  1725.          START = START + HNEW
  1726.          IF(MPRINT.LT.4) GO TO 27
  1727.          WRITE(*,11) KNTSTP, START
  1728.          K = X(33)
  1729.          WRITE(*,12) NAMES(K),X(1), X(2)
  1730.          K = Y(33)
  1731.          WRITE(*,12) NAMES(K),Y(1), Y(2)
  1732.    27 CONTINUE
  1733.       WRITE(*,14) NSTEPS
  1734.    28 CONTINUE
  1735.    29 STOP
  1736.       END
  1737.  
  1738.  
  1739. 3.1.4 DATA input file
  1740.  
  1741.     For most problems solved using the ATOMCC system, you should
  1742. communicate the initial conditions, the integration interval, the
  1743. coefficients in the differential equations, and the ATOMCC control
  1744. parameters by reading them from a DATA input file.
  1745.  
  1746.  
  1747.                               - 28 -
  1748.  
  1749.  
  1750.  
  1751.            Example 3-4.  DATA input file for Example 3-1.
  1752.  
  1753.  
  1754.   MPRINT   NSTEPS           for example 3-1
  1755.       4       80
  1756.   START      END   DLTXPT   ALPHA     X(1)     X(2)     Y(1)     Y(2)
  1757.   1.0     10.0      0.25     0.58    -1.0      0.0      0.0      4.3
  1758.  
  1759.  
  1760. 3.1.5 Solution file
  1761.  
  1762.     ATSPGM writes all of its messages and answers to your
  1763. terminal.  The format of the solution depends on the ATOMCC control
  1764. parameters (see Section 3.4). If you should wish to have the
  1765. solution written onto a disc file, you can use the execution
  1766. statement (ATSPGM > PRTOUT).  Then, all messages and answers will
  1767. be written to the solution file PRTOUT.  The solution file can also
  1768. contain informa- tion written by user supplied WRITE(*,xxx)
  1769. statements.  A portion of the solution file is given below.
  1770.  
  1771.             Example 3-5.  Solution file for Example 3-1.
  1772.  
  1773.  
  1774.   ATOMCC  Ver. 7.10, Copyright (C) 1985, Y. F. Chang; Solution results.
  1775.   ******
  1776.  MPRINT   NSTEPS           for example 3-1
  1777.      4       80
  1778.  START      END   DLTXPT   ALPHA     X(1)     X(2)     Y(1)     Y(2)
  1779.  1.000   10.000    .250     .580   -1.000     .000     .000    4.300
  1780.  
  1781.     Step number     0 at the point  1.0000E+00
  1782. values of
  1783. X.....  -1.00000E+00   .00000E+00
  1784. Y.....    .00000E+00  4.30000E+00
  1785.  
  1786.     Step number     1 at the point  1.1430E+00
  1787. values of
  1788. X.....  -9.94536E-01  7.08452E-02
  1789. Y.....   6.13850E-01  4.27990E+00
  1790.  
  1791.       Step number     2 at the point  1.2500E+00
  1792.   values of
  1793.   X.....    -9.85268E-01  9.92472E-02
  1794.   Y.....     1.07052E+00  4.25646E+00
  1795.  
  1796.     Step number     2 at the point  1.3400E+00
  1797. values of
  1798. X.....  -9.75709E-01  1.11976E-01
  1799. Y.....   1.45285E+00  4.24032E+00
  1800.  
  1801.       Step number     3 at the point  1.5000E+00
  1802.   values of
  1803.   X.....    -9.56779E-01  1.23037E-01
  1804.   Y.....     2.12958E+00  4.22039E+00
  1805.  
  1806.  
  1807.                               - 29 -
  1808.  
  1809.  
  1810.  
  1811.  
  1812.     Step number     3 at the point  1.6400E+00
  1813. values of
  1814. X.....  -9.39208E-01  1.27496E-01
  1815. Y.....   2.71959E+00  4.20915E+00
  1816.  
  1817.       Step number     4 at the point  1.7500E+00
  1818.   values of
  1819.   X.....    -9.25064E-01  1.29523E-01
  1820.   Y.....     3.18223E+00  4.20277E+00
  1821.  
  1822.       Step number     4 at the point  2.0000E+00
  1823.   values of
  1824.   X.....    -8.92333E-01  1.31982E-01
  1825.   Y.....     4.23159E+00  4.19295E+00
  1826.  
  1827.     Step number     4 at the point  2.1300E+00
  1828. values of
  1829. X.....  -8.75128E-01  1.32677E-01
  1830. Y.....   4.77644E+00  4.18942E+00
  1831.  
  1832.  
  1833. 3.1.6 User files
  1834.  
  1835.     It is often useful to create your own output files using WRITE
  1836. statements to produce output in a format of your choice.  Example
  1837. 3-6 shows a portion of such a file for plotting, produced by
  1838. Example 3-1.
  1839.  
  1840.                Example 3-6.  User file for plotting.
  1841.  
  1842.  
  1843. 2   1.25000E+00  -9.85268E-01   9.92472E-02   1.07052E+00   4.25646E+00
  1844. 3   1.50000E+00  -9.56779E-01   1.23037E-01   2.12958E+00   4.22039E+00
  1845. 4   1.75000E+00  -9.25064E-01   1.29523E-01   3.18223E+00   4.20277E+00
  1846. 4   2.00000E+00  -8.92333E-01   1.31982E-01   4.23159E+00   4.19295E+00
  1847. 5   2.25000E+00  -8.59178E-01   1.33133E-01   5.27900E+00   4.18678E+00
  1848. 5   2.50000E+00  -8.25810E-01   1.33750E-01   6.32514E+00   4.18258E+00
  1849. 6   2.75000E+00  -7.92324E-01   1.34112E-01   7.37039E+00   4.17953E+00
  1850. 6   3.00000E+00  -7.58765E-01   1.34340E-01   8.41497E+00   4.17723E+00
  1851. 6   3.25000E+00  -7.25160E-01   1.34490E-01   9.45904E+00   4.17542E+00
  1852. 6   3.50000E+00  -6.91524E-01   1.34594E-01   1.05027E+01   4.17398E+00
  1853. 6   3.75000E+00  -6.57866E-01   1.34667E-01   1.15461E+01   4.17279E+00
  1854. 7   4.00000E+00  -6.24192E-01   1.34720E-01   1.25891E+01   4.17179E+00
  1855.  
  1856.  
  1857.  
  1858.  
  1859. 3.2 Using block 1
  1860.  
  1861.  
  1862.     The first block contains the system of differential equations.
  1863. These equations are processed by ATOMCC to determine the recurrence
  1864. relations which should be written into ATSPGM to generate the
  1865. Taylor series for each component of the solution.
  1866.  
  1867.  
  1868.                               - 30 -
  1869.  
  1870.  
  1871.     The first block may also be used for ATOMCC options to control
  1872. the operation of the translator.  This is done by placing a COPTION
  1873. card at the beginning of ODEINP.  Multiple translator options may
  1874. be specified on the same line, i.e. COPTION DOUBLE, LENVAR=40.
  1875. Multiple COPTION cards are also allowed, but they must precede all
  1876. other cards.
  1877.  
  1878.  
  1879. 3.2.1 Format for the system of equations
  1880.  
  1881.     For the differential equations, DIFF(Y,X,N) is used to denote
  1882. the n-th derivative of the dependent variable y with respect to the
  1883. independent variable x.  The value of the variable N may range from
  1884. 1 to 6, inclusively.  The DIFF(X,Y,N) function is used to specify
  1885. ODE's just as with other standard FORTRAN operators and functions.
  1886. All functions supported by ATOMCC are listed in Section 4.2. The
  1887. statements in ODEINP can be either upper- or lower-case letters.
  1888. We use upper-case in this manual for emphasis.
  1889.  
  1890.     The input to ATOMCC follows FORTRAN conventions.  Comment cards
  1891. contain a 'C' in column 1. The entire comment card is reproduced in
  1892. ATSPGM.  A comment card must not contain a block terminator '$'.
  1893. Columns 1-5 are used to enter line numbers.  Column 6 is used for
  1894. continuation; there is a limit of 19 continuation lines in
  1895. FORTRAN.  Columns 7-72, where the block terminator '$' must appear,
  1896. contain the statements of the equations.  Columns 73-80 are
  1897. ignored.  As in FORTRAN, blanks are not significant.  (A word of
  1898. caution, the tab character is not recognized by ATOMCC.)
  1899.  
  1900.          The equations in block 1 must be of the form
  1901.  
  1902.          DIFF(X,Y,N) = expression,
  1903.          variable = DIFF(X,Y,N),
  1904. or       variable = expression.
  1905.  
  1906.     An expression may contain operations on variables and DIFF(,,)
  1907. functions.  The highest order derivative of each dependent variable
  1908. must be given explicitly by an equation of the form DIFF(,,) =
  1909. expression, but DIFF(,,) functions of lower order may appear in
  1910. expressions on the right hand side.  A system of differential
  1911. equations may be specified with more than one independent
  1912. variable.  But, each independent variable will have the same value
  1913. as the solution is computed.  Independent variables are implicitly
  1914. defined by the DIFF(,,) function for that independent variable, so
  1915. explicitly defining one in an assignment statement will cause an
  1916. error message to be printed which indicates that the independent
  1917. variable in question has already been defined.
  1918.  
  1919.     Incidentally, ATOMCC transforms all constant integer powers of
  1920. a variable up to 4 into multiplications.  This is done in order to
  1921. avoid the problems raised by the initial value of that variable
  1922. being equal to zero.  For integer powers greater than 4, the user
  1923. is responsible to see that a l'Hopital situation does not arise.
  1924.  
  1925.     Except for integer powers, constant coefficients which appear
  1926. in ODE's are converted to real numbers by ATOMCC, so that it does
  1927. not matter whether three is written as 3, 3.0, 3.E0, or 3.D0.
  1928.  
  1929.  
  1930.                               - 31 -
  1931.  
  1932.  
  1933.  
  1934.  
  1935. 3.2.2 Parameters in the equations
  1936.  
  1937.     Example 3-1 shows a system involving parameters.  It is often
  1938. interesting to explore the dependence of the solution on parameters
  1939. which appear in the differential equation.  The ATOMCC system is
  1940. especially well suited to this problem, because ATSPGM can be
  1941. generated only once and then executed repeatedly for different
  1942. values of the parameters.
  1943.  
  1944.     You may enter the parameters as constants directly into the
  1945. statement of the equations.  In that case, ATOMCC writes those
  1946. constants directly into ATSPGM; this approach does not allow easy
  1947. modification of the parameters.  Note that all constants (except
  1948. integer powers) are converted to real numbers by ATOMCC, so that it
  1949. does not matter whether three is written as 3, 3.0, 3.E0, or 3.D0.
  1950.  
  1951.     If you wish to change the values of the parameters, make each
  1952. parameter in the equation to appear as a variable as shown in
  1953. Example 3-1. Note that the variable parameters must be assigned
  1954. dummy values in block 1, even though the actual values may be
  1955. specified at solution time by statements in block 3.
  1956.  
  1957.     If the values of the parameters are to be supplied at solution
  1958. time by reading from a data file or from a terminal, it may be
  1959. convenient to solve the problem repeatedly as shown by Example 3-14
  1960. in Section 3.4.2.
  1961.  
  1962.  
  1963. 3.2.3 COPTION DOUBLE - Double-precision ATSPGM
  1964.  
  1965.     Unless you specify differently, the ATSPGM program generated by
  1966. ATOMCC is written in single-precision.  A COPTION DOUBLE card, as
  1967. the first card in ODEINP, signals ATOMCC to write ATSPGM in
  1968. double-precision.  No other changes should be made in block 1. In
  1969. particular, if the ODE's have library functions such as SIN, EXP,
  1970. etc., ATOMCC automatically inserts DSIN, DEXP, etc.  into ATSPGM.
  1971. You should not make those substitutions yourself.
  1972.  
  1973.            Example 3-7.  Double precision object program.
  1974.  
  1975.  
  1976. COPTION DOUBLE
  1977.       DIFF(Y,T,2) = 6*Y*Y + T    $
  1978.       $
  1979. C Read initial conditions and integration interval
  1980.       OPEN(5,FILE='DATA')
  1981.       READ(5,1010) START,END,Y(1),Y(2)
  1982.  1010 FORMAT(4F10.3)
  1983.       WRITE(*,1020) START,END,Y(1),Y(2)
  1984.  1020 FORMAT(' Solve the first Painleve transcendent' /
  1985.      + ' Interval:          ',2F10.3 /
  1986.      + ' Initial conditions:',2F10.3 /)       $
  1987.       $
  1988.  
  1989.  
  1990.                               - 32 -
  1991.  
  1992.  
  1993.  
  1994. In a double-precision ATSPGM program:-
  1995.  
  1996.   -  real variables are declared as double precision;
  1997.  
  1998.   -  double-precision FORTRAN functions (i.e. DLOG) are generated
  1999.      in ATSPGM; (The user must still use single-precision functions
  2000.      in the first block.)
  2001.  
  2002.   -  call statements in ATSPGM reference the double-precision
  2003.      ATOMCC library routines DRSET, DSTEP, and DRDCV;
  2004.  
  2005.   -  FORMAT statements use D-format for real variables;
  2006.  
  2007.   -  constants are generated in double-precision form.
  2008.  
  2009.     Some changes may be required in blocks 2, 3, and 4. ATOMCC
  2010. copies them directly into ATSPGM, so you are responsible for any
  2011. changes such as declarations or format modifications.
  2012.  
  2013.     Be sure to link ATSPGM.OBJ with the double-precision ATOMCC
  2014. subroutine library, DRDCV.OBJ.  Incidentally, stiff problems are
  2015. solved only in double-precision.
  2016.  
  2017.  
  2018. 3.2.4 COPTION COMPLX - Complex ATSPGM
  2019.  
  2020.     Including a COPTION COMPLX card as the first card in ODEINP
  2021. signals ATOMCC to write a single-precision complex ATSPGM.
  2022.  
  2023.                Example 3-8.  Complex object program.
  2024.  
  2025.  
  2026. COPTION COMPLX
  2027.       DIFF(Y,T,2) = 6*Y*Y + T    $
  2028.       $
  2029.       OPEN(5,FILE='DATA')
  2030.       READ(5,1010) MPRINT,NSTEPS,KPTS
  2031.  1010 FORMAT(3I5)
  2032.       WRITE(*,1010) MPRINT,NSTEPS,KPTS
  2033. C
  2034. C Read initial conditions
  2035.       READ(5,1020) Y(1),Y(2)
  2036.  1020 FORMAT(8F10.3)
  2037.       WRITE(*,1020) Y(1),Y(2)
  2038. C
  2039. C Read piecewise linear path
  2040.       READ(5,1020) (POINTS(I),I=1,KPTS)
  2041.       WRITE(*,1020) (POINTS(I),I=1,KPTS)  $
  2042.       $
  2043.  
  2044.     No other changes should be made in block 1. If the ODE's have
  2045. library functions like SIN, EXP, etc., ATOMCC automatically inserts
  2046. CSIN, CEXP, etc. into ATSPGM.  You should not write any complex
  2047. functions yourself.
  2048.  
  2049.     Some changes may be required in blocks 2, 3, and 4. ATOMCC
  2050. copies them directly into ATSPGM, so you are responsible for any
  2051.  
  2052.  
  2053.                               - 33 -
  2054.  
  2055.  
  2056. changes such as declarations or format modifications.  The
  2057. independent and dependent variables are complex, so each must have
  2058. both a real and an imaginary part.  So, FORMAT 1010 and 1020 are
  2059. changed from Example 3-7 to Example 3-8. We suggest that you study
  2060. an example of a complex ATSPGM to see which variables are of type
  2061. COMPLEX before you attempt to execute the program.
  2062.  
  2063.     The other important change required for a complex ATSPGM is the
  2064. manner in which the path of integration is specified.  The path of
  2065. integration is a piecewise linear path in the complex plane of the
  2066. independent variable.  The path consists of KPTS points stored in
  2067. the complex array POINTS as shown in Example 3-8. The complex path
  2068. of integration is discussed further in Section 3.4.14.
  2069.  
  2070.     For a normal search of the complex plane for singularities, it
  2071. is best to keep MPRINT=4.  Higher values of MPRINT only leads to
  2072. ever more confusing amounts of print outputs.
  2073.  
  2074.  
  2075. 3.2.5 COPTION DOUBLE, COMPLX - Double-complex ATSPGM
  2076.  
  2077.     Including a COPTION DOUBLE,COMPLX card, as the first card in
  2078. ODEINP, signals ATOMCC to write a double-precision complex ATSPGM.
  2079.  
  2080.             Example 3-9.  Double complex object program.
  2081.  
  2082.  
  2083. COPTION DOUBLE,COMPLX
  2084.       DIFF(Y,T,2) = 6*Y*Y + T    $
  2085.       $
  2086.       OPEN(5,FILE='DATA')
  2087.       READ(5,1010) MPRINT,NSTEPS,KPTS
  2088.  1010 FORMAT(3I5)
  2089.       WRITE(*,1010) MPRINT,NSTEPS,KPTS
  2090. C
  2091. C Read initial conditions
  2092.       READ(5,1020) Y(1),Y(2)
  2093.  1020 FORMAT(8F10.3)
  2094.       WRITE(*,1020) Y(1),Y(2)
  2095. C
  2096. C Read piecewise linear path
  2097.       READ(5,1020) (POINTS(I),I=1,KPTS)
  2098.       WRITE(*,1020) (POINTS(I),I=1,KPTS)  $
  2099.       $
  2100.  
  2101.     No other changes should be made in block 1. In particular, if
  2102. the ODE's have library functions like SIN, EXP, etc., ATOMCC
  2103. automatically inserts CDSIN, CDEXP, etc.  into ATSPGM.  You should
  2104. not make those substitutions yourself.  Example 3-10 is a portion
  2105. of ATSPGM generated for the input shown in Example 3-9.
  2106.  
  2107.                Example 3-10.  ATSPGM for Example 3-9
  2108.  
  2109.  
  2110. c*+*+*+*+*+*
  2111. c     This program was produced by the  ATOMCC  translator version 7.10
  2112. c                                       Copyright (C) 1985, Y. F. Chang
  2113. c*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
  2114.  
  2115.  
  2116.                               - 34 -
  2117.  
  2118.  
  2119. c Portions (c) Copyright, Microsoft Corp., 1981.  All rights reserved.
  2120. c This program was written for the following inputs
  2121. c
  2122. COPTION DOUBLE,COMPLX
  2123. C     DIFF(Y,T,2) = 6*Y*Y + T
  2124. c--------
  2125. c no instructions in second input block
  2126. c--------
  2127.       COMMON /IPASS/ LENSER,LENVAR,MPRINT,MSTIFF,LRUN,
  2128.      + KTRDCV,KNTSTP,KTSTIF,KXPNUM,KDIGS,KENDFG,NTERMS,NOPT
  2129.      A /RPASS/ RADIUS,ERRLIM,ADJSTF,RCREAL,RCIMAG,RDCERR
  2130.      B /CPASS/ START,END,ORDER
  2131.      C /DPASS/ H,HNEW
  2132.      D /PATHCM/ POINTS,VECTOR,KPTS,KPAST
  2133.       COMPLEX*16 START,END,POINTS(10),VECTOR,CZRO,DCMPLX
  2134.       COMPLEX ORDER
  2135.       DOUBLE PRECISION H,HNEW,AL
  2136.       COMPLEX*16 TMPS(  36,  1)
  2137.       CHARACTER*6 NAMES
  2138.       EQUIVALENCE (TMPS(1,1),Y(1))
  2139.       COMPLEX*16 Y(36), T(2), TMPAAB(30), TMPAAA(30)
  2140.       COMPLEX*16 SHIFT
  2141.       DIMENSION NAMES(1)
  2142.       DATA NAMES(1)/'Y.....'/
  2143.       Y(33) = 1.1
  2144.     9 FORMAT(2X,11HAbove is at,1P2D12.4,9H step no.,I4/)
  2145.    10 FORMAT(72H   ATOMCC  Ver. 7.10, Copyright (C) 1985, Y. F. Chang; S
  2146.      Aolution results./9H   ******)
  2147.  
  2148.  
  2149.       .  .  .  .
  2150.  
  2151.  
  2152.       CZRO = DCMPLX(0.D0,0.D0)
  2153. c--------
  2154. c start of third  input block
  2155. c--------
  2156.       OPEN(5,FILE='DATA')
  2157.       READ(5,1010) MPRINT,NSTEPS,KPTS
  2158.  1010 FORMAT(3I5)
  2159.       WRITE(*,1010) MPRINT,NSTEPS,KPTS
  2160. C
  2161. C Read initial conditions
  2162.       READ(5,1020) Y(1),Y(2)
  2163.  1020 FORMAT(8F10.3)
  2164.       WRITE(*,1020) Y(1),Y(2)
  2165. C
  2166. C Read piecewise linear path
  2167.       READ(5,1020) (POINTS(I),I=1,KPTS)
  2168.       WRITE(*,1020) (POINTS(I),I=1,KPTS)
  2169. c--------
  2170. c end of third  input block
  2171. c--------
  2172.  
  2173.  
  2174.       .  .  .  .
  2175.  
  2176.  
  2177.                               - 35 -
  2178.  
  2179.  
  2180. c--------
  2181. c Calculate radius of convergence and take optimum step.
  2182. c--------
  2183.          CALL CDRDCV(TMPS,LENVAR,NUMEQS,NAMES)
  2184. c--------
  2185. c no instructions in fourth input block
  2186. c--------
  2187.          GO TO (26,28), KENDFG
  2188.    26    AL = RADIUS
  2189.          H = DSIGN(AL,H)
  2190.          IF(MPRINT.GT.4 .OR. NOPT.EQ.0) GO TO 24
  2191.          WRITE(*,9) START,KNTSTP
  2192.    24    START = START + HNEW*VECTOR
  2193.          IF(MPRINT.LT.5) GO TO 27
  2194.          WRITE(*,11) KNTSTP,START
  2195.          K = Y(33)
  2196.          WRITE(*,12) NAMES(K),Y(1), Y(2)
  2197.    27 CONTINUE
  2198.       WRITE(*,14) NSTEPS
  2199.    28 CONTINUE
  2200.    29 STOP
  2201.       END
  2202.  
  2203.     Some changes may be required in blocks 2, 3, and 4. ATOMCC
  2204. copies them directly into ATSPGM, so you are responsible for any
  2205. changes such as declarations or format modifications.  The
  2206. independent and dependent variables are complex, so each initial
  2207. condition must have both a real and an imaginary part.
  2208.  
  2209.     The important change required for a complex ATSPGM is the
  2210. manner in which the path of integration is specified.  The path of
  2211. integration is a piecewise linear path in the complex plane of the
  2212. independent variable.  The path consists of KPTS points stored in
  2213. the complex array POINTS as shown in Example 3-8. The complex path
  2214. of integration is discussed further in Section 3.4.14.
  2215.  
  2216.     For a normal search of the complex plane for singularities, it
  2217. is best to keep MPRINT=4.  Higher values of MPRINT only leads to
  2218. ever more confusing amounts of print outputs.
  2219.  
  2220.  
  2221. 3.2.6 COPTION LENVAR=n - Series length
  2222.  
  2223.     The size of the arrays which contain each series is stored in
  2224. LENVAR.  The value of LENVAR may be changed by placing the
  2225. expression "LENVAR=n" on a COPTION card.  The length of the series
  2226. used is controlled by the variable LENSER (see Section 3.4.9).
  2227.  
  2228.                   Example 3-12.  COPTION LENVAR=n
  2229.  
  2230.  
  2231. COPTION LENVAR=100
  2232.       DIFF(POWER,TIME,4) = 3*DP2
  2233.       DP2 = DIFF(POWER,TIME,2)        $
  2234.       $
  2235.       OPEN(5,FILE='DATA')
  2236.       READ(5,1010) START,END,(POWER(I),I=1,4)
  2237.  1010 FORMAT(6F10.3)
  2238.  
  2239.  
  2240.                               - 36 -
  2241.  
  2242.  
  2243.       WRITE(*,1010) START,END,(POWER(I),I=1,4)  $
  2244.       $
  2245.  
  2246.     There are several circumstances under which you may wish to use
  2247. a series length which differs from the 30-term series used by
  2248. ATSPGM:-
  2249.  
  2250.   -  The system of ODE's contains no functions or products of
  2251.      dependent variables.  The cost of generating the series is
  2252.      then proportional to the series length (instead of the length
  2253.      squared), so using longer series may result in a faster
  2254.      execution time.
  2255.  
  2256.   -  A series begins with many zero terms.  Since ATSPGM requires
  2257.      series which have at least 8 nonzero terms, you must lengthen
  2258.      the series.
  2259.  
  2260.     Section 3.4.9 contains a discussion of the effect of series
  2261. length on the execution time of ATSPGM.
  2262.  
  2263.  
  2264. 3.2.7 COPTION DUMP=n - Diagnostic messages
  2265.  
  2266.     This feature involves the operation of the ATOMCC translator
  2267. itself and will rarely be used.  It was used during the development
  2268. of the software and is documented here only for completeness.  The
  2269. form is COPTION DUMP=n, where n indicates the amount of dump to be
  2270. written (on your screen).  The following is dumped for each n.
  2271.  
  2272.      5   after lexical and syntactical analysis,
  2273. and  4   after first optimization,
  2274. and  3   after equation sorting and variable type identification,
  2275. and  2   after implicit operator and operand analysis,
  2276. and  1   after second optimization.
  2277.  
  2278.     It is suggested that users who wish to consult with the authors
  2279. about a suspected bug in ATOMCC should have available the output
  2280. from a run in which "DUMP=5" was specified and directed to a file
  2281. for printing.
  2282.  
  2283.  
  2284.  
  2285.  
  2286. 3.3 Using block 2
  2287.  
  2288.  
  2289.     The second, third, and fourth blocks are not processed by
  2290. ATOMCC in the same way as the first input block.  ATOMCC merely
  2291. copies the data from your ODEINP file directly into ATSPGM.
  2292.  
  2293.     The second block is optional and is used to insert
  2294. non-executable FORTRAN statements at the beginning of ATSPGM.  This
  2295. block gives the user the ability to insert 'SUBROUTINE',
  2296. 'FUNCTION', 'COMMON', 'DATA', and 'DIMENSION' into ATSPGM.  Example
  2297. 3-13 shows where statements supplied in block 2 are inserted into
  2298. ATSPGM.
  2299.  
  2300.  
  2301.                               - 37 -
  2302.  
  2303.  
  2304.  
  2305.  
  2306. 3.3.1 Subroutine form of ATSPGM
  2307.  
  2308.     ATSPGM is normally generated as a main program which can then
  2309. be run to solve the specified problem.  The ATOMCC translator has
  2310. the capability to generate subroutine or function forms for
  2311. ATSPGM.  The subroutine or function can then be called from a user
  2312. supplied main program, or from another ATOMCC-generated main
  2313. program, to obtain the solution of the problem.
  2314.  
  2315.     A subroutine ATSPGM is specified by placing a SUBROUTINE
  2316. statement in the second block.  This statement is placed unchanged
  2317. at the beginning of the generated code, so you have complete
  2318. control of the name of the subroutine and its parameter list.
  2319. However, this also means that you have complete responsibility for
  2320. passing values to and returning values from the generated program
  2321. segment.  ATSPGM written by ATOMCC will have a RETURN statement
  2322. instead of a STOP at its end.  Example 3-13 shows the ODEINP for a
  2323. subroutine ATSPGM named DIFEQU, which solves the equation f' =
  2324. log(sin(x) + f).
  2325.  
  2326.               Example 3-13.  Subroutine form of ATSPGM
  2327.  
  2328.  
  2329.       DIFF(F,X,1) = ALOG(SIN(X) + F)   $
  2330.       SUBROUTINE DIFEQU(COND)        $
  2331.       F(1) = COND $
  2332.       $
  2333.  
  2334. with its calling program
  2335.  
  2336. C Driver program for Example 3-13.
  2337. C
  2338. C A very simple subroutine, START and END are passed through COMMON.
  2339. C
  2340.       COMMON/CPASS/ START,END,ORDER
  2341.  1010 FORMAT(6F10.3)
  2342.       READ(5,1010) COND,START,END
  2343.       WRITE(*,1010) COND,START,END
  2344.       CALL DIFEQU(COND)
  2345.       STOP
  2346.       END
  2347.  
  2348.     Many of the variables used in ATSPGM appear in COMMON, so they
  2349. cannot be passed as parameters.  Values can be passed through the
  2350. parameter list as temporary variables, or they can be passed in
  2351. COMMON by including the appropriate COMMON block in the calling
  2352. program as illustrated by Example 3-13.
  2353.  
  2354.  
  2355. 3.3.2 User declarations
  2356.  
  2357.     You may need to declare the type of the additional variables
  2358. you introduce into ATSPGM, if you use the double-precision or
  2359. complex forms of ATSPGM.  You may include appropriate DIMENSION,
  2360. DOUBLE, COMMON, DATA, etc.  in block 2. Any non-executable FORTRAN
  2361. statements inserted in the second block are copied into the
  2362.  
  2363.  
  2364.                               - 38 -
  2365.  
  2366.  
  2367. beginning of ATSPGM exactly as they are written, so you have total
  2368. control over the statements entered.  These statements must conform
  2369. to FORTRAN specifications; ATOMCC does not check their syntax or
  2370. the order of placement.
  2371.  
  2372.  
  2373. 3.3.3 Common blocks for user
  2374.  
  2375.     You may wish to use COMMON blocks.  COMMON declarations may be
  2376. included in block 2 like all non-executable FORTRAN statements
  2377. discussed in Section 3.3.2.
  2378.  
  2379.     Note that many of the variables used in ATSPGM appear in COMMON
  2380. blocks and must not be assigned to other blocks.
  2381.  
  2382.  
  2383.  
  2384.  
  2385. 3.4 Using block 3
  2386.  
  2387.  
  2388.     The third block must be used to specify the interval of
  2389. integration and the initial conditions.  It may also be used to
  2390. change the default values of method-control variables.  Default
  2391. values are changed by inserting statements which assign new values
  2392. to these variables.  If desired, other statements can be inserted
  2393. into ATSPGM at this point.  The user should have an understanding
  2394. of the form of ATSPGM and the relative position of the third block
  2395. in ATSPGM.  Examples 2-1 and 2-3 and Examples 3-1 and 3-3 are a
  2396. pair of ODEINP files with their respective ATSPGM programs.  you
  2397. can better understand how the method-control variables work by
  2398. studying the statements in the neighborhood of block 3.
  2399.  
  2400.     The assignment of values to each of the variables discussed in
  2401. this Section may be done by:
  2402.  
  2403.   1.  a READ statement (see Examples 2-1, 2-2, 3-1, 3-7, 3-11,
  2404.       3-12),
  2405.  
  2406.   2.  an assignment statement (see Example 2-6), or
  2407.  
  2408.   3.  being passed as temporary variables through a parameter list
  2409.       (see Example 3-13), or
  2410.  
  2411.   4.  common block shared with a driving main program (see Example
  2412.       3-13).
  2413.  
  2414.  
  2415.                               - 39 -
  2416.  
  2417.  
  2418.  
  2419.  
  2420. 3.4.1 Initial conditions
  2421.  
  2422.     The initial conditions must be specified in the third block.
  2423. The initial values at xo = START of the dependent variable, say
  2424. yyy, and its derivatives are assigned to the array yyy as follows:-
  2425.  
  2426.          YYY(1) denotes yyy at xo,
  2427.          YYY(2) denotes yyy' at xo,
  2428.          YYY(3) denotes yyy'' at xo, etc.
  2429.  
  2430.     The number of initial conditions which must be specified for
  2431. each dependent variable equals the highest derivative of that
  2432. variable which appears in the system of equations.  If the system
  2433. includes a DIFF(y,x,5), then five initial conditions must be
  2434. included for the dependent variable y.  ATOMCC does not check
  2435. whether initial conditions have been supplied, since it is possible
  2436. that the series variable has been passed through a subroutine
  2437. parameter list.  Therefore, it is your responsibility to see that
  2438. the required initial conditions are defined.
  2439.  
  2440.     When ATSPGM is a subroutine, the series variable may be passed
  2441. in the parameter list.  In this case, the initial conditions may be
  2442. stored in the proper elements of the series array before ATSPGM is
  2443. executed.  An alternative to passing the series via the parameter
  2444. list is to pass the initial conditions as temporary variables in
  2445. the parameter list.  Assignment statements in the third block then
  2446. assign the values to the appropriate dependent variable array
  2447. elements.
  2448.  
  2449.     Note to those who are familiar with the Taylor series method:-
  2450. the initial conditions should be entered as explained above; that
  2451. is, Y(3) = y''(xo), not y''(xo)*h*h/2, since this shifting is done
  2452. automatically by ATSPGM.
  2453.  
  2454.  
  2455. 3.4.2 Parameters in the differential equations
  2456.  
  2457.     It is often interesting to explore the dependence of the
  2458. solution on parameters in the ODE's.  Section 3.2.2 and Example 3-1
  2459. showed how the system of equations is entered and how values of the
  2460. parameter are assigned.  A refined version of Example 3-1 is shown
  2461. in Example 3-14. Here, a loop is used to read successive values of
  2462. the parameter.  See the object program listing in Example 3-3 and
  2463. observe that statement '28 CONTINUE' is provided by ATOMCC for this
  2464. purpose.
  2465.  
  2466.              Example 3-14.  Read parameters repeatedly.
  2467.  
  2468.  
  2469.       DIFF(X,T,2) = - ALPHA*X*R
  2470.       DIFF(Y,T,2) = - ALPHA*Y*R
  2471.       R = (X*X + Y*Y)**(-1.5)
  2472.       ALPHA = 0.65             $
  2473.       $
  2474. C Read and echo print code, number of integration steps.
  2475.       OPEN(5,FILE='DATA')
  2476.  
  2477.  
  2478.                               - 40 -
  2479.  
  2480.  
  2481.       READ(5,1010) MPRINT,NSTEPS
  2482.  1010 FORMAT(2I10)
  2483.       WRITE(*,1010) MPRINT,NSTEPS
  2484. C
  2485. C Read and echo interval and initial conditions to be used each time.
  2486.       READ(5,1020) OLDSTR,OLDEND,X1,X2,Y1,Y2
  2487.  1020 FORMAT(6F10.3)
  2488.       WRITE(*,1020) OLDSTR,OLDEND,X1,X2,Y1,Y2
  2489. C
  2490. C Loop for different values of the parameter.
  2491.       DO 28 IPROB=1,20
  2492.       READ(5,1020) ALPHA
  2493.       IF(ALPHA.EQ.0.0) STOP
  2494.       WRITE(*,1020) ALPHA
  2495.       START = OLDSTR
  2496.       END = OLDEND
  2497.       X(1) = X1
  2498.       X(2) = X2
  2499.       Y(1) = Y1
  2500.       Y(2) = Y2          $
  2501.       WRITE(7,1030) KINTS,START,X(1),X(2),Y(1),Y(2)
  2502.  1030 FORMAT(I5,1P5E14.5)   $
  2503.  
  2504.  
  2505. 3.4.3 Solve a problem repeatedly
  2506.  
  2507.     In Example 3-14, the statement 'DO 28 IPROB=1,20' is included
  2508. in block 3 to solve the same system of differential equations as
  2509. many as 20 times without restarting the program.  The statement '28
  2510. CONTINUE' near the end of ATSPGM is written by ATOMCC for this
  2511. purpose.  Within this loop, you may vary values of parameters as in
  2512. this example, you may vary the initial conditions, or you may vary
  2513. the method-control variables.
  2514.  
  2515.  
  2516. 3.4.4 START, END - Interval of integration
  2517.  
  2518.     The integration interval must be specified in the third block
  2519. using the two reserved words START and END.  Their use is
  2520. illustrated by all the examples.
  2521.  
  2522.     If a complex ATSPGM is being used, then the interval of
  2523. integration is a piecewise linear path in the complex plane of the
  2524. independent variable.  The specification of complex paths of
  2525. integration is discussed in Sections 3.4.13 and 3.4.14.
  2526.  
  2527.  
  2528. 3.4.5 NSTEPS - Number of integration steps, default=40
  2529.  
  2530.     The maximum number of integration steps taken during the
  2531. solution is the variable NSTEPS.  The default value (40) can be so
  2532. small because the use of long series allows very large integration
  2533. steps.  You may change this value by inserting a statement in the
  2534. third input block which assigns a new value to NSTEPS, or you may
  2535. read in a value for NSTEPS from a data file.
  2536.  
  2537.     For some stiff problems and in searching for singularities in
  2538. the complex plane, it is best to set NSTEPS at a large value.
  2539.  
  2540.  
  2541.                               - 41 -
  2542.  
  2543.  
  2544.  
  2545.  
  2546. 3.4.6 H - Initial trial stepsize, default = 1.0
  2547.  
  2548.     The default value of the suggested initial stepsize can be
  2549. changed by assigning the desired value to the variable H in the
  2550. third block.  The term "suggested initial stepsize" is used because
  2551. this value may be adjusted by ATSPGM before the first step is
  2552. taken.  This adjustment is made if its need is indicated by an
  2553. analysis of the Taylor series for underflow/overflow.  The user can
  2554. rarely make a better choice than ATOMCC.
  2555.  
  2556.     For stiff problems, in addition to the adjustment of H in
  2557. ATSPGM at the first integration step, the stepsize H is adjusted
  2558. within DRDCV at every step.  The adjustments at the first integra-
  2559. tion step may need some manual assistance.  In such cases, observe
  2560. the values generated by the ATSPGM program and project forward to
  2561. the next reasonable value and enter it for H.
  2562.  
  2563.  
  2564. 3.4.7 ERRLIM - Preset accuracy of the solution
  2565.  
  2566.     The local error tolerance is the variable ERRLIM.  ATSPGM will
  2567. keep the maximum local error less than ERRLIM.  The magnitude of
  2568. ERRLIM is automatically set by ATOMCC to be close to the computer
  2569. round-off error in both single- and double-precision.  You may set
  2570. ERRLIM to be much larger; however, your results will become
  2571. inaccurate.  You may not set ERRLIM to be much smaller.
  2572.  
  2573.     The error analysis for normal problems is so precise that one
  2574. can almost expect the global error to be under control.  This is
  2575. one numerical method where the global error is proportional to the
  2576. local error.  Therefore, to determine the magnitude of the global
  2577. error, one only needs to run the solution a second time with an
  2578. ERRLIM set one order of magnitude smaller than the first run and
  2579. compare the two results.
  2580.  
  2581.  
  2582. 3.4.8 ADJSTF - Error control for stiff problems
  2583.  
  2584.     The error analysis for stiff problems is not nearly as well
  2585. developed as the error analysis for normal problems.  In solving
  2586. stiff problems, it is necessary to make assumptions regarding both
  2587. the exponential function and the polynomial that are used to fit
  2588. the solution being sought.  Therefore, an error-controlling
  2589. parameter separate from ERRLIM is used.  The default value for
  2590. ADJSTF is 1.E-2. Also, the value of ERRLIM is fixed to 1.E-6 for
  2591. stiff problems.  The user is advised to change ADJSTF to lower
  2592. values and make additional runs of the solution to be certain of
  2593. its correctness.
  2594.  
  2595.     There is absolutely no connection between a particular value of
  2596. ADJSTF and the magnitude of the error in the computations.  The
  2597. most that is claimed is that as the value of ADJSTF is adjusted
  2598. smaller, there is likely to be a lowering of the computational
  2599. error.  Since the nature of stiff solutions is an approximation,
  2600. there can be no true error control.  And so, none is attempted.
  2601.  
  2602.  
  2603.                               - 42 -
  2604.  
  2605.  
  2606.  
  2607.  
  2608. 3.4.9 LENSER - Length of series used, default=30
  2609.  
  2610.     The length of the Taylor series is the variable LENSER.  This
  2611. value may be changed by assigning a new value to LENSER in the
  2612. third block.  However, there are some restrictions governing how
  2613. this is done.
  2614.  
  2615.     LENSER may be set to any integer between 15 and 30 without any
  2616. other changes.  Series of fewer than 15 terms should not be used.
  2617. If a series of more than 30 terms is desired, the size of all
  2618. series variables (LENVAR) must be increased (see Section 3.2.6).
  2619. The user is reminded that the execution time is related to the
  2620. length of the series.  The default value of LENSER=30 have been
  2621. found to be optmial for fast execution.
  2622.  
  2623.     In stiff solutions, LENSER is automatically set to either 15 or
  2624. 10 depending on the parameter MSTIFF.  In these cases, the user
  2625. cannot change these set values of LENSER without going into the
  2626. subroutine DRDCV.
  2627.  
  2628.  
  2629. 3.4.10 MPRINT - Amount of print produced, default=4
  2630.  
  2631.     The amount of printout produced by ATSPGM during the solution
  2632. of the problem is controlled by the variable MPRINT.  Values of
  2633. every dependent variable at each integration step is printed with
  2634. an MPRINT=4.  The user can change the default by assigning MPRINT a
  2635. different value in the third block.  The amount of printout
  2636. produced for values of MPRINT is listed below.
  2637.  
  2638.    0  Used for timing purposes; printout is produced only when a
  2639.       fatal error occurs.
  2640.  
  2641.    1  No print is produced, but the loop controlled by RSET is
  2642.       activated to produce user controlled print (see Section 3.5.2).
  2643.  
  2644.    2  Print is produced only at points selected by the user.  The
  2645.       printout consists of the integration step number, the value of
  2646.       the independent variable and the initial conditions for each
  2647.       dependent variable.
  2648.  
  2649.    4  (default) Print the information for 2 at every integration step.
  2650.       (In complex solutions, only the singularity locations are
  2651.       printed here.)
  2652.  
  2653.    5  In addition to the output under 4, the actual stepsize used
  2654.       at each integration step is printed.  In stiff problems, the
  2655.       exponential function and the length of the polynomial are
  2656.       printed.  In stiff problems, the estimated HSTF and the
  2657.       relative goodness of the exponential fit are printed.  (In
  2658.       complex solutions, MPRINT=5 is equivalent to 4)
  2659.  
  2660.    6  In addition to the information for 5, print (a)the computed
  2661.       radius of convergence, (b)location of the singularity(ies),
  2662.       and (c)which test was used to locate the poles.
  2663.  
  2664.  
  2665.                               - 43 -
  2666.  
  2667.  
  2668.    7  In stiff problems, the entire results for the exponential fit
  2669.       are printed.
  2670.  
  2671.    8  All of MPRINT=6, plus (a)the estimated error in h/Rc, (b)the
  2672.       values of the elements of each series, and (c)messages for
  2673.       all tests used for the radius of convergence.
  2674.  
  2675.   10  All diagnostic messages including all the series terms.
  2676.  
  2677.     Users who will use ATOMCC often should try setting MPRINT=10 to
  2678. become familiar with the information available during the solution
  2679. of a problem.
  2680.  
  2681.     The value of MPRINT may be dynamically controlled during the
  2682. computation of a solution by inserting statements in the fourth
  2683. block which test the current value of START (or KINTS), and set the
  2684. value of MPRINT accordingly.
  2685.  
  2686.  
  2687. 3.4.11 DLTXPT - Print point increments, default = 0.0
  2688.  
  2689.     ATSPGM uses variables XPRINT and DLTXPT to control values of
  2690. the independent variable for which print is produced.  We will
  2691. discuss a variety of ways these variables can be used.
  2692.  
  2693.     If DLTXPT=0.0, then print is produced only at the integration
  2694. steps chosen by the program.  This is the default condition.
  2695.  
  2696.     Print is produced at equally spaced points by specifying DLTXPT
  2697. = xxx (the desired spacing) as shown in Example 2-8 in Section 2.3.
  2698. A statement may be placed in the third block which assigns the
  2699. desired value to DLTXPT.  You should also specify MPRINT=2.
  2700. Otherwise print is produced both at your selected points and also
  2701. at the integration steps selected by ATSPGM.  MPRINT is discussed
  2702. in Section 3.4.10.
  2703.  
  2704.     The values of each dependent variable are printed at the
  2705. equally spaced points by expanding a series which has already been
  2706. computed.  The integration does not step to the equally spaced
  2707. points.  Hence, requesting intermediate output has no effect on the
  2708. number or size of integration steps taken.
  2709.  
  2710.     More creative print points are possible by the use of block 4.
  2711. See Example 3-15 in Section 3.5.3.
  2712.  
  2713.     DLTXPT can be used in stiff solutions to generate output at
  2714. desired values of the independent variable.  DLTXPT cannot be used
  2715. in conjuction with ZEROT, where the solution may be stopped for any
  2716. value of any function.
  2717.  
  2718.  
  2719. 3.4.12 KTRDCV - Dynamic suppression of CALL RDCV
  2720.  
  2721.     KTRDCV can be used to speed up the execution of ATSPGM for
  2722. systems of ODE's for which some components of the solution do not
  2723. constrain the integration stepsize.  For KTRDCV=N, the series
  2724. analysis is performed only for the first N components of the
  2725. solution.  You can generate ATSPGM once, run it to see the radii of
  2726.  
  2727.  
  2728.                               - 44 -
  2729.  
  2730.  
  2731. convergence of each component, and use KTRDCV on subsequent runs to
  2732. reduce the execution time of ATSPGM.  You should order the input
  2733. ODE's such that those with larger radii are listed last.  Careful
  2734. study of the ATSPGM program for a sample system of ODE's will help
  2735. you see how KTRDCV works.
  2736.  
  2737.  
  2738. 3.4.13 KPTS - Number of points on complex path
  2739.  
  2740.     In Section 3.4.4, we discussed the specification of the
  2741. interval of integration using START and END.  If ATOMCC has been
  2742. directed to generate complex object code (COPTION COMPLX, Sections
  2743. 3.2.4 or 3.4.5), then the path of integration is a piecewise linear
  2744. path in the complex plane of the independent variable.  See Example
  2745. 3-8 in Section 3.2.4.
  2746.  
  2747.     The variable KPTS is the number of vertices belonging to that
  2748. piecewise linear path, including both of the endpoints.  The
  2749. complex array 'POINTS' holds the vertices.  POINTS(1) becomes
  2750. START, and POINTS(KPTS) becomes END.  The value of the solution is
  2751. printed at each element of POINTS.  KPTS may be at most 10.
  2752.  
  2753.  
  2754. 3.4.14 POINTS - Complex path of integration
  2755.  
  2756.     The complex array 'POINTS' specifies the path of integration in
  2757. the complex plane of the independent variable.  Its use with KPTS
  2758. is discussed in Section 3.4.13. There may be at most 10 points
  2759. specified.
  2760.  
  2761.  
  2762. 3.4.15 MSTIFF=10 - Solutions which are entire
  2763.  
  2764.     Solutions which are entire (have no singularities in the finite
  2765. plane), should not be solved using the ATOMCC system.  It is a
  2766. total waste of computing power to solve linear problems using
  2767. ATOMCC.  This is particularly true for linear 'stiff' problems.
  2768.  
  2769.     It can be EASILY show that ALL solutions that are entire can be
  2770. solved in quasi-closed forms.  This INCLUDES two-point boundary
  2771. value problems!
  2772.  
  2773.     If ATOMCC recognizes that a system of ODE's involves no
  2774. functions or products (an entire solution), it sets MSTIFF=10 in
  2775. ATSPGM.  Subroutine RDCV recognizes MSTIFF=10 as a flag for a
  2776. special test for series that is entire.
  2777.  
  2778.  
  2779. 3.4.16 MSTIFF=20,21,22 - Stiff problems.
  2780.  
  2781.     This version of ATOMCC contains a double-precision algorithm to
  2782. solve stiff problems.  To use it, one can either set MSTIFF=20, or
  2783. 21, or 22. Other parameters that should be controlled are H,
  2784. ADJSTF, and NSTEPS.  It is also desirable to set MPRINT to 7, at
  2785. least initially, for observing the progress of the solution.  If it
  2786. should be evident that the problem is not really stiff, then it is
  2787. most advisable to solve it as a normal problem.
  2788.  
  2789.  
  2790.                               - 45 -
  2791.  
  2792.  
  2793.     MSTIFF=20 is the more conservative of the three algorithms.  In
  2794. this case, LENSER is set to be 15. The default value for ADJSTF,
  2795. the error-controlling parameter, is a rather large 1.E-2. The user
  2796. should run the stiff solution at least one more time with a
  2797. somewhat smaller ADJSTF, say 1.E-3, to check on its validity.
  2798. Since the default value for NSTEPS is 40, this should definitely be
  2799. set at 500 or more, to be sure that the stiff solution can be
  2800. completed.  The initial stepsize H may need some adjustment by the
  2801. user.  He should study the H-adjustment messages from ATSPGM and
  2802. take over control if and when the automatic adjustment is incapable
  2803. of reaching a desirable value for H. When MSTIFF=20, those stiff
  2804. problems that have steady-state solutions are identified.  After
  2805. which, one should perform some manual manipulations before
  2806. re-submitting the problem to ATOMCC.
  2807.  
  2808.     When MSTIFF=21, LENSER is set to only 10. So, this option
  2809. should be used only if the user is absolutely certain that the
  2810. problem under study is very stiff.  The solution of stiff problems
  2811. under this option is considerably faster than that for MSTIFF=20,
  2812. because not only are the series shorter, the integration stepsizes
  2813. are considerably larger.  The same statements as above applies for
  2814. the parameters H, ADJSTF, and NSTEPS.  (One of the Enright-Hull set
  2815. of stiff problems, E2, was solved by ATOMCC in one step!)  There is
  2816. no attempt to identify steady-state solutions when MSTIFF=21.
  2817.  
  2818.     MSTIFF=22 is identical to MSTIFF=20 except for the fact that
  2819. there is no attempt to identify steady-state solutions.
  2820.  
  2821.     As mentioned above, the stiff algorithm is written in double-
  2822. precision.  It is simply not cost effective to solve such problems
  2823. using single-precision.  There is one other restriction on stiff
  2824. problems.  All such problems must be stated as first-degree ODE's.
  2825.  
  2826.     The regular printing option, DLTXPT, functions properly in
  2827. stiff solutions.  So, it is possible to obtain uniformly spaced
  2828. print points or logarithmicaly spaced print points.
  2829.  
  2830.  
  2831. 3.4.16.1 Steady-State Stiff Problems
  2832.  
  2833.     There are some stiff problems that approach steady-state solu-
  2834. tions.  Sometimes this occurs with all of the functions becoming
  2835. constant simultaneously.  In such a case, the ATOMCC solution will
  2836. stop and points out the fact that every function seem to have
  2837. reached constant values.  The user can decrease ADJSTF and repeat
  2838. the solution to verify the truth of this fact.  He can also run the
  2839. problem with MSTIFF=22 and observe the perpetual singleness of the
  2840. results.
  2841.  
  2842.     In other instances, a particular function reaches constancy
  2843. before any of the others.  When this happens, the following message
  2844. will be printed, with obvious meaning.
  2845.  
  2846. The function Y4.... is constant at  3.115283D-04
  2847.   Look for a steady-state solution.
  2848.   Set all derivatives to zero, use the value of Y4.... given above,
  2849.     and solve for the other functions in easy situations.
  2850.   Then, re-submit to ATOMCC.  Use MSTIFF=21 or 22, do not use MSTIFF=20.
  2851.  
  2852.  
  2853.                               - 46 -
  2854.  
  2855.  
  2856.  
  2857.     This example is for the problem CHEM6 out of the Enright-Hull
  2858. set of chemical stiff problems.  This solution stopped at time =
  2859. 0.0561, where the solution had hardly gotten started.  After
  2860. solving the easy cases as suggested, the ATOMCC solution of the
  2861. re-submitted problem reached the final time of 1000 in 26 steps
  2862. using MSTIFF=21!
  2863.  
  2864.     The equational input for the first ATOMCC run is as follows.
  2865.  
  2866.       DIFF(Y1,T,1) = 1.3*(Y3-Y1) + 10400*AK*Y2
  2867.       DIFF(Y2,T,1) = 1880*(Y4 - Y2*(1+AK))
  2868.       DIFF(Y3,T,1) = 1752 - 269*Y3 + 267*Y1
  2869.       DIFF(Y4,T,1) = 0.1 + 320*Y2 - 321*Y4
  2870.       AK = EXP(20.7 - 1500/Y1)
  2871.  
  2872. The equational input for the second ATOMCC run, after encountering
  2873. the constancy message is as follows.
  2874.  
  2875.       DIFF(Y1,T,1) = 1.3*(Y3-Y1) + 10400*AK*Y2
  2876.       DIFF(Y2,T,1) = 1880*(Y4 - Y2*(1+AK))
  2877.       Y3 = 1752/269 + 267/269*Y1
  2878.       Y4 = 3.115283E-04
  2879.       AK = EXP(20.7 - 1500/Y1)
  2880.  
  2881. The differences between to two inputs are in the third and fourth
  2882. equations.
  2883.  
  2884.  
  2885.  
  2886.  
  2887. 3.5 Using block 4
  2888.  
  2889.  
  2890.     ATOMCC copies the fourth block directly into ATSPGM near the
  2891. end of the code for each integration step.  Example 3-3 in Section
  2892. 3.1.3 shows the location of block 4 in ATSPGM.  The fourth block is
  2893. used to tailor ATSPGM to your special requirements.  Several
  2894. examples are provided in Section 3.1.1, but many other creative
  2895. uses are possible.  Most applications require a good knowledge of
  2896. the ATOMCC system for solving ODE's.
  2897.  
  2898.  
  2899. 3.5.1 Automatic printing of output points
  2900.  
  2901.     The ATSPGM program automatically prints the values of each
  2902. component of the solution at each integration step (see Example 2-7
  2903. in Section 2.2.6). It can print the same information at equally
  2904. spaced points you select using DLTXPT (see Section 3.4.11). This
  2905. technique for generating output at equally spaced points requires
  2906. no use of block 4, but it will help you to understand subsequent
  2907. sections if you understand how ATSPGM generates this equally spaced
  2908. output.  Please refer to the object code in Example 3-3 in Section
  2909. 3.1.3 as you read.
  2910.  
  2911.     The points selected for output do not affect the integration
  2912. steps so that the local error remains proportional to the global
  2913. error.  For each output point within an integration step, the
  2914.  
  2915.  
  2916.                               - 47 -
  2917.  
  2918.  
  2919. solution is computed by evaluating its Taylor series.  Inside the
  2920. subroutine RSET, each output point within the the integration step
  2921. is controlled by a loop which begins with the statement '24 IF
  2922. (KENDFG.EQ.3) KENDFG=1' and ends with the statement 'GO TO
  2923. (26,28,24), KENDFG'.  KENDFG is a flag which controls the loop.
  2924.  
  2925.     Subroutine RDCV sets KENDFG=2 if the current steps reaches END,
  2926. otherwise KENDFG=1.  Subroutine RSET determines whether the next
  2927. output point (XPRINT) lies within the next step of integration.  If
  2928. not, RSET leaves KENDFG unchanged (1 or 2) and stores the initial
  2929. conditions required by the next step.  If there is a print point
  2930. within the next integration step, RSET prints the solution at that
  2931. output point (suppressed if MPRINT=0 or 1), stores values of the
  2932. series and its derivatives as elements LENSER+1, LENSER+2,...  in
  2933. the series, and sets KENDFG=3.  Then, the 'GO TO' in ATSPGM returns
  2934. to label 24 to handle additional output points within the next
  2935. integration step.  Once all of the output points within the next
  2936. step have been passed, RSET returns KENDFG to its original value (1
  2937. or 2), and the solution proceeds forward.
  2938.  
  2939.     You can use DLTXPT to generate output at equally spaced points
  2940. without understanding how that output is generated, but if you wish
  2941. to produce some special output as discussed in the following
  2942. Sections, this understanding is necessary.
  2943.  
  2944.  
  2945. 3.5.2 User controlled printing of output points
  2946.  
  2947.     The object program automatically prints the values of each
  2948. component of the solution at each integration step (see Example 2-7
  2949. in Section 2.2.6). The method used to produce output at user
  2950. selected points is discussed in Section 3.5.2. However, you may use
  2951. block 4 as shown in Example 3-1 in Section 3.1.1 to produce output
  2952. according to your particular needs.
  2953.  
  2954.     The execution time for ATSPGM is sensitive to the amount of
  2955. output produced.  Unless you are interested in the automatically
  2956. produced output, place MPRINT=1 in block 3. Then, RSET controls the
  2957. necessary looping as discussed in Section 3.5.1, but it produces no
  2958. output.  This yields the solution at equally spaced points.
  2959. Unequal spacing can be achieved by changing DLTXPT within block 4.
  2960. Example 3-15 in Section 3.5.3 shows how to obtain the solution at
  2961. logarithmically spaced points.
  2962.  
  2963.     Many variables are accessible for your use in block 4. The
  2964. elements of the array for each dependent variable, [y(LENSER+1),
  2965. y(LENSER+2), etc.], contain the values of that variable and its
  2966. derivatives evaluated at XPRINT.  The user can therefore print
  2967. these values totally independent from the print produced by
  2968. ATSPGM.  Additional usable values are stored in the top three
  2969. positions of the series; y(LENVAR-2) is the series length actually
  2970. used for that particular variable, y(LENVAR-1) is the multiplying
  2971. constant for the exponential function in stiff solutions, and
  2972. y(LENVAR) is the exponential coefficient in stiff solutions.
  2973.  
  2974.  
  2975.                               - 48 -
  2976.  
  2977.  
  2978.  
  2979.  
  2980. 3.5.3 Logarithmic spacing of output points
  2981.  
  2982.     The techniques discussed in Sections 3.5.1 and 3.5.2 produce
  2983. values of the solution at equally spaced points.  Output at
  2984. non-uniformly spaced points is obtained by adjusting DLTXPT and
  2985. XPRT3 within block 4 as shown by Example 3-15. The print points are
  2986. at r = 100, 50, 20, 10, 5, 2, etc.  This example also shows that
  2987. problems can be integrated in the negative direction.
  2988.  
  2989.                  Example 3-15.  Logarithmic print.
  2990.  
  2991.  
  2992.       DIFF(F,R,2) = (F**3 - F)/R**2  $
  2993.       $
  2994.       START = 100.0
  2995.       END = 1.0E-8
  2996.       F(1) = 0.99
  2997.       F(2) = 1.0E-4
  2998.       DLTXPT = -50.0
  2999.       NPTR = 1
  3000.       $
  3001.       IF(KENDFG .NE. 3) GO TO 25
  3002.       MPRINT = 2
  3003.       GO TO (501,503,502), NPTR
  3004.   501 DLTXPT = - 0.6*XPRINT
  3005.       GO TO 504
  3006.   502 NPTR = 0
  3007.   503 DLTXPT = - 0.5*XPRINT
  3008.   504 NPTR = NPTR + 1
  3009.       XPRT3 = XPRINT + DLTXPT  $
  3010.  
  3011.  
  3012. 3.5.4 ZEROT - Stopping and printing at roots of variables
  3013.  
  3014.     It is often of interest to locate points at which a component
  3015. of the solution has a root or assumes some specified value.  The
  3016. subroutine ZEROT, in the ATOMCC subroutine library in single-
  3017. precision, do automatically solve such problems.  DZEROT is the
  3018. double-precision version.
  3019.  
  3020.     The form of the CALL is
  3021.  
  3022.              CALL ZEROT(NUMBER,Y,ROOT,KEY,TMPS,LENVAR,NUMEQS)
  3023.  
  3024.     where
  3025.  
  3026.     NUMBER is the index of the Y series term whose root is sought,
  3027.     Y      is the variable whose root is desired,
  3028.     ROOT   is the value Y is to assume (= 0 for a root),
  3029.     KEY    is 1 if Y is a dependent variable, or
  3030.               0 if Y is not a dependent variable.
  3031.  
  3032.     The arguements TMPS, LENVAR, and NUMEQS must be exactly as
  3033. written above.
  3034.  
  3035.  
  3036.                               - 49 -
  3037.  
  3038.  
  3039.  
  3040.                Example 3-16.  Rootfinding with ZEROT.
  3041.  
  3042.  
  3043.       DIFF(Y,T,2) = 6*Y*Y + T  $
  3044.       $
  3045.       START = 0.0
  3046.       END = 1.15
  3047.       ROOT = 20.0
  3048.       Y(1) = 1.0
  3049.       Y(2) = 0.0
  3050.       $
  3051.       CALL ZEROT(1,Y,ROOT,1)
  3052.       $
  3053.  
  3054.     When the variable whose root is being sought is not a dependent
  3055. variable, the following statements are used.  Note that KEY is set
  3056. to 0.
  3057.  
  3058.         CALL ZEROT(2,VARY,0.0,0)
  3059.         IF(LRUN.NE.0) GO TO 25
  3060.         TEMP = START + HNEW
  3061.         WRITE(7,1010) KINTS,TEMP,VARY(1),VARY(2)
  3062.    1010 FORMAT(I5,3F10.4)
  3063.         GO TO 25  $
  3064.  
  3065.     In these examples, it is not necessary for one to print the
  3066. information as shown in the second case.  The ATSPGM program does
  3067. stop and restart the solution automatically at the exact root and
  3068. the output is controlled by MPRINT.
  3069.  
  3070.     ZEROT requires that the series for the variable be convergent
  3071. over the range of the integration stepsize being used.  If the
  3072. series is not convergent over this range, then ZEROT cannot
  3073. possibly locate the root with any degree of accuracy.  There are
  3074. two instances where this convergence requirement is not met.  One
  3075. is where the printing steps have been placed under the control of
  3076. DLTXPT, and the other is where a stiff problem is being solved.
  3077. Therefore, ZEROT cannot be used for a non-zero DLTXPT, and in stiff
  3078. problems.
  3079.  
  3080.     The index NUMBER can be set at any positive (non-zero) integer
  3081. value; however, obviously when NUMBER is very large the accuracy of
  3082. the root will suffer.
  3083.  
  3084.  
  3085. 3.5.5 Finding singularities in real solutions
  3086.  
  3087.     (This information is only for those users who are interested in
  3088. finding the conjugate pairs of singularities closest to the real
  3089. axis.  For a more detailed study of singularities, the user should
  3090. invoke COPTION COMPLX, Section 3.2.4)
  3091.  
  3092.     A unique feature of the ATOMCC system is its ability to provide
  3093. analytic information about the solution.  For example, subroutine
  3094. RDCV estimates the location and order of primary singularities at
  3095. each integration step in order to compute the optimal stepsize.
  3096. This information may be printed using MPRINT=6 (see Section
  3097.  
  3098.  
  3099.                               - 50 -
  3100.  
  3101.  
  3102. 3.4.10). However, several steps are usually required to pass
  3103. between a conjugate pair of singularities, so several different
  3104. estimates for each location are written.  Estimates made close to
  3105. the singularities are more accurate than estimates made from
  3106. further away.
  3107.  
  3108.     Example 3-17 prints only one estimate for the location and
  3109. order of each conjugate pair of singularities.  That estimate is
  3110. written on the step which has just begun to recede from the
  3111. estimated location.  Hence that step is one of the two steps
  3112. closest to the singularity pair.
  3113.  
  3114.        Example 3-17.  Finding singularities in real solutions
  3115.  
  3116.  
  3117. COPTION DOUBLE
  3118. C
  3119. C Test dynamic printing of singularity positions.
  3120. C
  3121.       DIFF(Y1,T,1) = 2*(Y1 - Y1*Y2)
  3122.       DIFF(Y2,T,1) = Y1*Y2 - Y2     $
  3123.       $
  3124.       ERRLIM = 1.0E-6
  3125.       START = 0.0
  3126.       END = 20.0
  3127.       Y1(1) = 1.0
  3128.       Y2(1) = 3.0
  3129.       MPRINT = 10
  3130.       PRTSNG = START
  3131.       SNGTOL = 0.1
  3132.       WRITE(8,2010)
  3133.  2010 FORMAT(///6H  Step,9X,1Hx,10X,2HRc,8X,4HReal,
  3134.      A 8X,4HImag,7X,5Horder,7X,5Herror/)
  3135.       $
  3136. C
  3137. C Print locations of singularities.
  3138. C
  3139.       WRITE(*,2010)
  3140.       WRITE(*,2020) KINTS,START,RADIUS,RCREAL,RCIMAG,ORDER,RDCERR
  3141. C
  3142. C If this is a user print step, then continue.
  3143.       IF(KENDFG.EQ.3) GO TO 25
  3144.       IF(KINTS.EQ.NSTEPS) GO t0 102
  3145. C If this is a normal step, then jump.
  3146.       IF(KENDFG.EQ.1) GO TO 105
  3147. C Handle the last step  -  we might be approaching a singularity
  3148. C  if we have already printed this primary singularity, then continue.
  3149.   102 IF(ABS(RCREAL-PRTSNG).LT.SNGTOL) GO TO 25
  3150. C If RDCV was uncertain, then continue.
  3151.       IF(RDCERR.GE.1.0) GO TO 25
  3152.       WRITE(8,2020) KINTS,START,RADIUS,RCREAL,RCIMAG,ORDER,RDCERR
  3153.  2020 FORMAT(I4,1P6E12.3)
  3154.       GO TO 25
  3155. C
  3156. C Handle a normal step.
  3157. C
  3158. C If confused, then continue.
  3159.   105 IF(RDCERR.GE.1.0) GO TO 25
  3160.  
  3161.  
  3162.                               - 51 -
  3163.  
  3164.  
  3165. C If approaching the primary singularity, then continue.
  3166.       IF((START-RCREAL)*H.LE.0.0) GO TO 25
  3167. C If already printed, then continue.
  3168.       IF(ABS(RCREAL-PRTSNG).LT.SNGTOL) GO TO 25
  3169.       WRITE(8,2020) KINTS,START,RADIUS,RCREAL,RCIMAG,ORDER,RDCERR
  3170.       PRTSNG = RCREAL   $
  3171.  
  3172.                   Example 3-18.  Printed locations
  3173.  
  3174.  
  3175. Step     x         Rc       Real       Imag      order      error
  3176.  
  3177.  1  0.000E+00  5.978E-01 -3.364E-01  4.941E-01  9.457E-01  5.588E-04
  3178.  9  5.180E+00  4.954E-01  5.151E+00  4.945E-01  9.784E-01  7.081E-04
  3179. 19  1.083E+01  5.297E-01  1.063E+01  4.943E-01  9.595E-01  2.888E-04
  3180. 28  1.627E+01  5.145E-01  1.612E+01  4.943E-01  9.662E-01  2.660E-04
  3181.  
  3182.  
  3183. 3.5.6 Stopping short of a singularity
  3184.  
  3185.     If one component of the solution has a singularity inside the
  3186. interval of integration, then the problem does not have a solution
  3187. on that interval, so the integration process should stop.  ATSPGM
  3188. stops when NSTEPS steps have been taken (see Section 3.4.5), or it
  3189. stops when the integration stepsize is so small relative to the
  3190. current point of expansion that the solution would not advance.
  3191.  
  3192.  
  3193.  
  3194.  
  3195. 3.6 Editing of ATSPGM
  3196.  
  3197.  
  3198.     While the use of blocks 2, 3, and 4 to insert FORTRAN code
  3199. directly into ATSPGM gives you a very powerful and flexible tool,
  3200. you may have needs which can only be met by editing ATSPGM
  3201. yourself.  Section 3.6.1 uses the relatively common problem of
  3202. producing efficient output at specified points to illustrate the
  3203. approach.
  3204.  
  3205.  
  3206. 3.6.1 TERM - Fast generation of printing at output points
  3207.  
  3208.     The printing of solution values at equally spaced points has
  3209. already been discussed in Sections 2.3, 3.4.11, 3.5.1, and 3.5.2.
  3210. The technique discussed in Section 3.5.2 can be used to generate
  3211. nearly all of the information about the solution at any points you
  3212. select.  The execution time is much faster using MPRINT=1, to
  3213. suppress printing by RSET, than with MPRINT=2 or 4.
  3214.  
  3215.     The execution time of ATSPGM can be further reduced by
  3216. controlling the looping for each print point within the current
  3217. integration step by calling the subroutine TERM to evaluate the
  3218. series for the solution at any desired point.  This subroutine is
  3219. listed as Example 3-19.
  3220.  
  3221.  
  3222.                               - 52 -
  3223.  
  3224.  
  3225.  
  3226.                  Example 3-19.  TERM source listing
  3227.  
  3228.  
  3229. C  SUBROUTINE TERM(SERIES,NTERMS,T,WORKAR)
  3230. C
  3231. C  ATOMCC-LIBRARY, COPYRIGHT  (C)  1983.
  3232. C
  3233. C  EVALUATES SERIES AND ITS DERIVATIVES AT T
  3234. C
  3235. C  AT ENTRY, 'SERIES' CONTAINS A SERIES EXPANDED AT SOME POINT
  3236. C  'START' WITH A STEP OF 'H'.
  3237. C
  3238. C  AT EXIT, WORKAR(1)  = FUNCTION EVALUATED AT T
  3239. C         WORKAR(2)  = DERIVATIVE OF FUNCTION EVALUATED AT T
  3240. C         . . .
  3241. C         WORKAR(NTERMS) = NTERMS - 1 DERIVATIVE EVALUATED AT T
  3242. C
  3243. C  PARAMETERS:
  3244. C    SERIES  -  SERIES BEING SUMMED
  3245. C    NTERMS  -  NUMBER OF INITIAL CONDITIONS NEEDED
  3246. C    T      -  POINT AT WHICH SERIES IS TO BE EVALUATED
  3247. C    WORKAR  -  WORK AREA, SAME TYPE AS SERIES, DIMENSION NTERMS
  3248. C
  3249.      SUBROUTINE TERM (SERIES, NTERMS, T, WORKAR)
  3250. C********  DATA DECLARATIONS
  3251.      DIMENSION SERIES(1), WORKAR(1)
  3252.      COMMON /CPASS/START,END,ORDER
  3253.     A  /DPASS/H,HNEW,XPRINT,DLTXPT
  3254.     +  /IPASS/LENSER,LENVAR,MPRINT,MSTIFF,LRUN,KTRDCV,
  3255.     +   INTSTP,KTSTIF,KXPNUM,KDIGS,KENDFG,NTERMS
  3256. C********  COMPUTE INITIAL CONDITIONS AND STORE THEM IN WORK AREA
  3257.      RATIO = (T-START)/H
  3258.      DUMMY = H/FLOAT(LENSER)
  3259.      DO 40 I=1,NTERMS
  3260.       ILEN = LENSER - I - 1
  3261.       DUMMY = DUMMY*FLOAT(LENSER - I + 1)/H
  3262.       DLOOP = DUMMY
  3263.       SUM = SERIES(LENSER)*RATIO*DLOOP
  3264.       DO 30 J=1,ILEN
  3265.        LMJ = LENSER - J
  3266.        DLOOP = DLOOP*FLOAT(LMJ-I+1)/FLOAT(LMJ)
  3267.        SUM = (SUM + DLOOP*SERIES(LMJ))*RATIO
  3268.    30  CONTINUE
  3269.       WORKAR(I) = SUM + DLOOP*SERIES(I)/FLOAT(I)
  3270.    40 CONTINUE
  3271. C********  RETURN
  3272.  9999 RETURN
  3273.      END
  3274.  
  3275.     To illustrate the use of subroutine TERM as an example of
  3276. editing ATSPGM, Example 3-20 shows the ODEINP file which was used
  3277. to generate ATSPGM listed as Example 3-21. Three arrays have been
  3278. dimensioned to hold the results computed by TERM, and new variables
  3279. DXP and FIRSTX have been defined to fill roles analogous to DLTXPT
  3280. and XPRINT.
  3281.  
  3282.  
  3283.                               - 53 -
  3284.  
  3285.  
  3286.  
  3287.                Example 3-20.  ODEINP for TERM example
  3288.  
  3289.  
  3290.      S = 10.0
  3291.      DIFF(X,T,3) = Y - E*S*X
  3292.      DIFF(Y,T,3) = - X*Z + X - E*Y
  3293.      DIFF(Z,T,3) = X*Y - E*B*Z
  3294.      E = 0.02
  3295.      B = 8.0/3.0  $
  3296.      DIMENSION USER1(3),USER2(3),USER3(3)  $
  3297.      OPEN(7,FILE='DATA')
  3298.      OPEN(8,FILE='FAST',STATUS='NEW')
  3299.      READ(7,*) X(1),Y(1),Z(1)
  3300.      READ(7,*) X(2),Y(2),Z(2)
  3301.      READ(7,*) X(3),Y(3),Z(3)
  3302.      READ(7,*) START,END,DLTXPT
  3303.      READ(7,*) DXP
  3304.      FIRSTX = START
  3305.      WRITE(*,1010) X(1),Y(1),Z(1),START,END,DLTXPT,FIRSTX,END,DXP
  3306.  1010 FORMAT(3F10.4)
  3307.      NSTEPS = 5
  3308.      WRITE(8,1020)
  3309.  1020 FORMAT(3X,1Ht,5X,1Hx,7X,2Hx',6X,3Hx'',
  3310.     + 5X,1Hy,7X,2Hy',6X,3Hy'',5X,1Hz,7X,2Hz',6X,3Hz''/)    $
  3311.      $
  3312.  
  3313. with data file
  3314.  
  3315.   1.0,3.0,5.0
  3316.   0.0,0.0,0.0
  3317.   -1.0,0.0,1.0
  3318.   0.0,5.0,0.5
  3319.   0.5
  3320.  
  3321.     The following lines of code must be inserted just below the
  3322. CALL RDCV statement inside ATSPGM.  A portion of the results are
  3323. shown in Example 3-22.
  3324.  
  3325.            Example 3-21.  Object program for Example 3-20
  3326.  
  3327.  
  3328.          CALL RDCV(TMPS,LENVAR,NUMEQS)
  3329. c=========== User must insert these lines by editing.
  3330.   100 IF(FIRSTX.GE.START+HNEW) GO TO 24
  3331.       CALL TERM(X,3,FIRSTX,USER1)
  3332.       CALL TERM(Y,3,FIRSTX,USER2)
  3333.       CALL TERM(Z,3,FIRSTX,USER3)
  3334.       WRITE(8,1030) FIRSTX,USER1,USER2,USER3
  3335.  1030 FORMAT(1X,F3.1,1P9E8.1)
  3336.       FIRSTX = FIRSTX + DXP
  3337.       GO TO 100
  3338. c=========== end of user inserted lines.
  3339.    24    IF(KENDFG.EQ.3) KENDFG = 1
  3340.  
  3341.  
  3342.                               - 54 -
  3343.  
  3344.  
  3345.  
  3346.                Example 3-22.  Output for Example 3-20
  3347.  
  3348.  
  3349.   t    x       x'      x''     y       y'      y''     z       z'     z''
  3350.  
  3351. 0.0 1.0E+00 0.0E+00-1.0E+00 3.0E+00 0.0E+00 0.0E+00 5.0E+00 0.0E+00 1.0E+0
  3352. 0.5 9.3E-01-1.5E-01 3.9E-01 2.9E+00-5.0E-01-2.0E+00 5.1E+00 8.3E-01 2.3E+0
  3353. 1.0 9.6E-01 3.7E-01 1.6E+00 2.3E+00-2.0E+00-4.1E+00 5.9E+00 2.3E+00 3.4E+0
  3354. 1.5 1.4E+00 1.4E+00 2.3E+00 6.9E-01-4.8E+00-7.4E+00 7.5E+00 4.2E+00 4.1E+0
  3355.  
  3356.  
  3357.  
  3358.  
  3359. 3.7 Large systems
  3360.  
  3361.  
  3362.     As supplied to you, the ATOMCC translator can handle up to 900
  3363. equations.  If you should have a need to increase this limit, a
  3364. special program can be easily prepared.
  3365.  
  3366.  
  3367.  
  3368.  
  3369. 3.8 Solving ODE's in the complex domain
  3370.  
  3371.  
  3372.     The ATOMCC compiler allows for the solution of ODE's in the
  3373. complex domain.  This unique capability can be used to explore the
  3374. structure of the singularities in the complex domain of non-linear
  3375. problems.  Linear problems, of course, have entire solution
  3376. functions and therefore do not have any singularities of interest
  3377. in the finite complex plane.  Non-linear problems may have
  3378. singularities which cover the entire complex plane.
  3379.  
  3380.     There are essentially two types of non-linear problems; those
  3381. with definite limit cycles, and those with strange attractors.  For
  3382. the former, the singularities form a regular lattice in the complex
  3383. plane.  For the latter, the singularities form structures that defy
  3384. simple descriptions.  The purpose of solving ODE's in the complex
  3385. domain is to study the structures formed by the singularities.  The
  3386. ATOMCC compiler is well suited for this task, and it is the only
  3387. method extant that is capable of calculating the precise location
  3388. and order of all the singularities in a finite region of the
  3389. complex plane of an ODE solution.
  3390.  
  3391.     It is simple to use the ATOMCC compiler to search for the
  3392. singularities.  First, you must insert a COPTION COMPLX card as the
  3393. first card in ODEINP.  This will cause the ATOMCC compiler to
  3394. generate ATSPGM that will solve the ODE using paths into the
  3395. complex domain.  Secondly, you must specify the path to be taken by
  3396. the solution.  This path is fixed by specifying the vertices of
  3397. straight-line segments in the path.  The path taken must be
  3398. composed of straight-line segments.  The first vertex is of course
  3399. the starting point of the solution.  A maximum of ten vertices may
  3400. be specified.  These vertices are to be placed into an array called
  3401. POINTS, and the number of vertices used is stored in the variable
  3402.  
  3403.  
  3404.                               - 55 -
  3405.  
  3406.  
  3407. KPTS.  The ATOMCC solution will follow the path thus specified and
  3408. locate all the singularities near this path.
  3409.  
  3410.     Since the ATOMCC solution will find all the singularities near
  3411. the path specified by the user, certain problems may occur.  First,
  3412. the user may have by accident specified a path exactly midway
  3413. between two singularities.  In this event, there will be no
  3414. information output from ATOMCC.  The path must be slightly closer
  3415. to one singularity than another; otherwise, ATOMCC cannot find the
  3416. nearest singularity.  Secondly, the user may have by accident
  3417. specified a path that is too close to a singularity, or perhaps
  3418. even a path that is directly pointed at a singularity.  In this
  3419. event, the ATOMCC solution will grind away and take very small
  3420. steps.  The information from ATOMCC beyond any such close encounter
  3421. will be unreliable.  In all cases, the user is well advised to
  3422. change the path in the complex plane ever so slightly and make a
  3423. second run to double check his results.  In our experience, it is
  3424. best to perform the complex integrations using double precision.
  3425. Insert a COPTION DOUBLE,COMPLX card as the first card in your
  3426. input.  With just minimal experience, the user will find the use of
  3427. ATOMCC in the complex plane to be fast and easy.
  3428.  
  3429.     For good results, the first leg of the path into the complex
  3430. domain should be directed straight up in the imaginary direction.
  3431. Do not make the first leg of the path coincident with the real
  3432. axis.  This introduces subtraction errors into the complex
  3433. solution.
  3434.  
  3435.     When there are complex constants in the equations, the user is
  3436. entirely responsible for seeing to it that those constants are
  3437. properly specified with TYPE declarations in block 2, and the
  3438. values are properly entered as CMPLX(--,--) or DCMPLX(--,--) in
  3439. block 3. The reason for this requirement on the part of the user is
  3440. because if the facts are otherwise, the user may then be required
  3441. to use an editor to delete some possibly incorrect specification
  3442. written by ATOMCC.  It is better to be a bit short and correct than
  3443. to be long and in error.
  3444.